Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cpjamloki
Visitor

Is there is Any example of SetMaxVideoDecodeResolution()

In roku sdk there is no brief explanation about SetMaxVideoDecodeResolution(), how ,where and in which situation we should use this interface of video player.

As i guess , SetMaxVideoDecodeResolution() generally use for memory release.

By using command r2d2_bitmaps i am getting: Available memory 29329344 used 9670656 max 39000000

But except roku 3 every devices have 256 MB storage.
so for whom max 39000000 (39 MB) indicating? what is it means?

and please tell me also is there any example for SetMaxVideoDecodeResolution()
0 Kudos
5 REPLIES 5
NewManLiving
Visitor

Re: Is there is Any example of SetMaxVideoDecodeResolution()

There is some documentation at: http://sdkdocs.roku.com/display/sdkdoc/ifVideoPlayer#ifVideoPlayer-SetMaxVideoDecodeResolutionwidtha...

In simple terms it is the maximum video resolution that you expect to use for your channel. This would only apply to those devices that use OpenGL, since the 2D API texture memory is a shared resource with Video Decode Memory. So for a device that uses OpenGL, if you know that your maximum video resolution will be 1280 x 720 you must set the value in SetMaxVideoDecodeResolution to at least 1280 x 720. If you do not, the movie will load but kind of hangs right there. With non-OpenGl this does not apply. I'm speaking about the current line of devices. So if you do not expect to use anything more than 720 x 480 then its best to set this value so the resources can be allocated to the 2D API

As far as what r2d2_bitmaps displays is device specific. Basically it is the amount of memory that you have available to load your bitmaps. Once exceeded you will get an invalid bitmap handle upon creation
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
cpjamloki
Visitor

Re: Is there is Any example of SetMaxVideoDecodeResolution()

Thanx NewManLiving for nice reply. Can you explain 2D API texture memory?
0 Kudos
NewManLiving
Visitor

Re: Is there is Any example of SetMaxVideoDecodeResolution()

Video decode memory is a shared resource with OpenGL texture memory. For a discussion on OpenGL texture management you can consult any online resource. Rendering textures and decoding video frames are both memory intensive. After all the ROKU model is no NVIDIA GeForce Experience. Video decode memory allocation is based on a resolution of 1920x1080 or 1280x720 as the maximum supported resolution for a particular ROKU model. So it seems that you have 2 maximum memory allocations which are model specific; if you can trust the documentation :?: I suppose this means that video takes allocation precedence. I do not know the internal semantics. However, for our purposes it is safe to assume that it does. As a 2D programmer you have additional overhead and concerns related to the various models: chips, firmware, OpenGL/ no OpenGL and last but not least - inadequate documentation. I presently own current generation models and can speak only about my 2D experience with them. I know nothing about the legacy models. The important thing for me is to decide what video resolution I will be supporting and release any additional memory back to the system to be used as it is needed. Right now I have a client who uses a maximum of 1280x720. Since this resolution should be supported on all current models (according to documentation) I set my SetMaxVideoDecodeResolution accordingly so that any deivce that uses 1920x1080 will release the additional memory. This is all speculative according to the limited documentation that exists and my current understanding of it. Perhaps someone else could throw more light on the subject
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
cpjamloki
Visitor

Re: Is there is Any example of SetMaxVideoDecodeResolution()

yes SetMaxVideoDecodeResolution will release the additional memory. but my concern is that how i know that previous i have 'X' memory and after release i have 'X--' memory.
is there any method to know available memory, used memory, max ,memory?

As i have used r2d2_bitmaps, but it is only for graphics bitmaps.

how i know memory used by my video resolution?
0 Kudos
NewManLiving
Visitor

Re: Is there is Any example of SetMaxVideoDecodeResolution()

How it effects the amount of memory available to you as a developer is unclear. No it does not change the amount you see with r2d2_bitmaps. I have never had a problem. I find it Best to use only one roscreen and be smart about my bitmap size and usage. I use the texturemanager, and roUrlTransfer to get around the limitations.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.