Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
drbrundage
Posts: 21
Registered: ‎06-01-2011
My Device: Curve
My Carrier: Verizon

Size of video recording screen

 

I am attempting to implement video recording and everything seems to be working pretty well now, except I can't get the video preview screen to be full size. I have tried all of the following:

 

1) _videoControl.setDisplaySize( Display.getWidth(), Display.getHeight() );

 

2) _videoControl.setDisplayFullScreen(true);

 

3) Creating a LayoutManager as per http://supportforums.blackberry.com/t5/tkb/articleprintpage/tkb-id/java_dev@tkb/article-id/458 (which allows me to move around the preview screen but I can't get it to go to full screen).

 

My code, within my class that extends MainScreen, to display the video preview is as follows.

 

    videoField = (Field) _videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
// _videoControl.setDisplayFullScreen(true);
   _videoControl.setDisplaySize( Display.getWidth(), Display.getHeight() );
   _videoControl.setVisible(true);
   add(videoField);
   _player.start();

 

I have observed this behavior on 9330 simulator and phone and a 9930 phone. The 9330's use version 6.0 operating system and the 9930 uses 7.0.

 

Thanks in advance for any suggestions on how I might get the preview screen to be full screen.

Please use plain text.
Developer
Anand04
Posts: 94
Registered: ‎06-05-2012
My Device: Developer
My Carrier: Developer

Re: Size of video recording screen

Hi, 

 

add video field in any manager and use sublayout method of manager to give width and height.....

Please use plain text.
Contributor
drbrundage
Posts: 21
Registered: ‎06-01-2011
My Device: Curve
My Carrier: Verizon

Re: Size of video recording screen

Item #3 that I mentioned above does that and I tried it in a 2nd way without success.

 

1) For item #3, I created the LayoutManager class with the slight modification of putting x and y at 0.

 

public class LayoutManager extends Manager {   
    public LayoutManager() {       
        //construct a manager with vertical scrolling     
        super(Manager.VERTICAL_SCROLL);   
    }   
    
    //overwrite the nextFocus method for custom navigation   
    protected void sublayout(int width, int height) {       
        Field field;     
        //get total number of fields within this manager       
        int numberOfFields = getFieldCount();       
        // A vertical spacing of 50units is created       
        int y = 0;              
        int x = 0;
        // Laying out every field in the manager evenly       
        for (int i = 0;i < numberOfFields;i++) {           
            field = getField(i); //get the field           
            setPositionChild(field,x,y); //set the position for the field           
            layoutChild(field, width, height); //lay out the field           
        }       
        setExtent(width, height);   
    }
}

 

Then I added it as follows, where fullScreenManager is an instance of LayoutManager:

 

                videoField = (Field) _videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE,"net.rim.device.api.ui.Field");
//                _videoControl.setDisplayFullScreen(true);
                _videoControl.setDisplaySize( Display.getWidth(), Display.getHeight());
                _videoControl.setVisible(true);
                add(fullScreenManager);
                fullScreenManager.add(videoField);
                _player.start();

 

This left the video screen the same size as before, but now is starts in the upper left corner (before it was horizontally centered, though not vertically).

 

2) I also tried just adding videoField (using add(videoField) to my VideoScreen class (which extends MainClass and is therefore a Manager) and overriding SubLayout within that class. The SubLayout function through an error at setPositionChild stating that videoField was not a child of the manager.

 

Note also from my previous message that setDisplayFullScreen throws an exception stating that setDisplayFullScreen is not a supported operation, which results in a blank white screen.

Please use plain text.
Developer
Anand04
Posts: 94
Registered: ‎06-05-2012
My Device: Developer
My Carrier: Developer

Re: Size of video recording screen

[ Edited ]

Hi,

You can use:

VerticalFieldManager vfm = new VerticalFieldManager(){
protected void sublayout(int width, int height) {
write code here and set width and height
}
};

vfm.add(videoField);

 

 

code is not tested in simulator....

 

Please use plain text.
Contributor
drbrundage
Posts: 21
Registered: ‎06-01-2011
My Device: Curve
My Carrier: Verizon

Re: Size of video recording screen

Is their something that I am missing or doing wrong in the VerticalFieldManager (the only field I am adding to the manager is the video field):

 

        private VerticalFieldManager vfm = new VerticalFieldManager(Manager.USE_ALL_WIDTH | Manager.USE_ALL_HEIGHT) {
            protected void sublayout(int width, int height) { 
                setPositionChild(getField(0),0,0);            
                layoutChild(getField(0), width, height);         
                setExtent(width, height);   
            }
        };

 

I have added it as a variable to a class that extends MainScreen. In that class, I do the following:

 

add(vfm);
vfm.add(videoField);

 

For the 9330 simulator and phone, I get a video screen that takes up roughly 2/3 of the screen, horizontally centered and vertically starting at the top. For the 9650 simulator it is much closer to a full screen, with just a small strip at the top and bottom of the video preview screen. The 9930 is similar to the 9650 (both phone and simulator) except the top and bottom strips are larger.

 

Please use plain text.
New Developer
shivam284
Posts: 108
Registered: ‎01-23-2012
My Device: torch,bold,curve,strom
My Carrier: Blackberry

Re: Size of video recording screen

Hi ,

I think you have wriiten correct code . bt in place of weidth use the screenweidth and in place of height use screen height.

Hope it will work!

Thanks & Regards,
Kumar Shivam
Please use plain text.
Developer
Anand04
Posts: 94
Registered: ‎06-05-2012
My Device: Developer
My Carrier: Developer

Re: Size of video recording screen

Hi,

 

your code is correct just a little changes:

 

  private VerticalFieldManager vfm = new VerticalFieldManager() {
            protected void sublayout(int width, int height) { 
                setPositionChild(getField(0),0,0);            
                layoutChild(getField(0), width, height); //// in place of width and height use width //and heigh you want for video screen.....      
                setExtent(width, height);   //same for here also
            }
        };
Please use plain text.
Contributor
drbrundage
Posts: 21
Registered: ‎06-01-2011
My Device: Curve
My Carrier: Verizon

Re: Size of video recording screen

Thanks guys, but still no luck.

 

I did try setting the width and height to 320 and 240 respectively within the sublayout method, but that didn't work.

 

The reason I tried setting them directly is due to some debugging I did on both the 9330 simulator and device.  I call _video.setDisplaySize(Display.getWidth(), Display.getHeight()) which I assume then calls sublayout. In both cases, the width came back as 320 and the height came back as 1073741823 (which, I guess interestingly, is the value for the constant net.rim.blackberry.api.mail.MessageStatus TX_RETRIEVING_KEY).

 

That being said, I am not sure the 1073741823 is a problem as I get the same value with the 9650 simulator though the video preview screen is full size (my mistake in my previous message saying it wasn't quite full size). The 9930 simulator has the same 1073741823 value for the height, but the video preview screen, as mentioned before, is full width but not full height.

 

Is it possible that the 9330 and 9930 don't support a full screen video preview?

Please use plain text.