Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:53:32+00:00 2026-06-16T04:53:32+00:00

OMX provides a struct with following definition /* Parameter specifying the content URI to

  • 0

OMX provides a struct with following definition

/* Parameter specifying the content URI to use. */
typedef struct OMX_PARAM_CONTENTURITYPE
{
OMX_U32 nSize;
/**< size of the structure in bytes */
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
OMX_U8 contentURI[1];     /**< The URI name*/
}OMX_PARAM_CONTENTURITYPE;
OMX_IndexParamContentURI,
/**< The URI that identifies the target content. Data type is OMX_PARAM_CONTENTURITYPE. */

I have got a constant char array to set.

char* filename = "/test.bmp";

As far as I understood I need somehow to set memcopy filename to struct.contentURI and then to update the struct.size accordingly. How can I do it?

Best regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:53:33+00:00Added an answer on June 16, 2026 at 4:53 am

    First you need to allocate enough memory to contain the fixed-size parts and the filename:

    size_t uri_size = strlen(filename) + 1;
    size_t param_size = sizeof(OMX_PARAM_CONTENTURITYPE) + uri_size - 1;
    OMX_PARAM_CONTENTURITYPE * param = malloc(param_size);
    

    adding 1 to include the termination character, and subtracting 1 because the structure already contains an array of one byte.

    In C++, you’ll need a cast, and you should use a smart pointer or a vector for exception safety:

    std::vector<char> memory(param_size);
    OMX_PARAM_CONTENTURITYPE * param = 
        reinterpret_cast<OMX_PARAM_CONTENTURITYPE *>(&memory[0]);
    

    Then you can fill in the fields:

    param->nSize = param_size;
    param->nVersion = whatever;
    memcpy(param->contentURI, filename, uri_size);
    

    and don’t forget to free(param) once you’ve finished with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

07-06 06:58:25.609: I/OMXCodec(113): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 800 x 440 @ (0, 0) 07-06
I has this following code to show a VideoView on top of anything that
In Android ICS and later, a new OpenMax IL API version is in use,
Possible Duplicate: How can I pass a class member function as a callback? I
I am about to grab the video output of my raspberry pi to pass
Last night, my app was working just fine streaming audio files with the MediaPlayer
Oh.. i always have error in prepare (of mediarecorder). Error tell me what prepare
I'm new in Android development and I have the next question/problem. I'm playing around
I wrote a little Python program that looks though a directory (and its subdirectories)
This question has also been asked at Problems with MediaRecorder class setting audio source

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.