How to set media format in IMFMediaSource

I'm, trying to implement a grabber using IMFMediaSource, IMFMediaSession and IMFTopology. I built a topology including the IMFMediaSource and an IMFSampleGrabberSinkCallback. My problem is how to set the current media format. I found a function in msdn:
HRESULT cMFDevice::setDeviceFormat(IMFMediaType *i_type)
IMFPresentationDescriptor *presentationDescriptor = nullptr;
HRESULT hr = m_mediaSource->CreatePresentationDescriptor(&presentationDescriptor);
if (SUCCEEDED(hr))
BOOL selected = FALSE;
IMFStreamDescriptor *streamDescriptor = nullptr;
hr = presentationDescriptor->GetStreamDescriptorByIndex(0, &selected, &streamDescriptor);
if (SUCCEEDED(hr))
IMFMediaTypeHandler *handler = nullptr;
hr = streamDescriptor->GetMediaTypeHandler(&handler);
if (SUCCEEDED(hr))
hr = handler->SetCurrentMediaType(i_type);
SafeRelease(&handler);
SafeRelease(&streamDescriptor);
SafeRelease(&presentationDescriptor);
return hr;
That function works. But only once. If I start the session and stopped it, the current format does change. All return values are fine, but format does not changes in OnProcessSample callback. Any ideas? Do I have to rebuilt complete topology? Must I stop
the session?

See Chapter 6 of the Pages User Guide PDF. You can download it from the Help menu.
Once you have mastered Styles, you should be on top of this problem. You may have some specific questions on formatting along the way, and there are lots of experts here to help you.
Jerry

Similar Messages

  • How to set raw format for canon powershot a1100 is ? ,,according to the specs online it can.

    how to set raw format  for canon powershot  a1100 is ? ,,according to the specs online it can.

    It requires the Canon Hacker's Developement Kit (CHDK). It runs off of your SD card and does not harm your camera. Download a program called Stick-
    http://zenoshrdlu.com/stick/stick.html
    Follow the directions and you will be able to shoot in RAW along with some other deatures not available on your camera previously.

  • How to set exponential format for a cell?

    Hello! Can someone advise how to set exponential format for a cell in Numbers?

    Hi Alejandro,
    If you mean 1000 as 1E+03
    Format Panel > Cell > Data Format > Scientific
    Regards,
    Ian.

  • How to set the format mask

    Hi,
    Good Evening,
    How to set the format mask to text fields based on currencies.

    Hi Anil,
    i am taking one method for setting the format mask to front end values
    like this
    public String xxformatmask(String test,String currency,OAPageContext pageContext)
    String currencyFormattedNumber="";
    try {
    java.lang.Double num = new java.lang.Double(test);
    currencyFormattedNumber = pageContext.getOANLSServices().formatCurrency(num,currency);
    catch(Exception e) {
    System.out.println("the exception is"+e);
    return currencyFormattedNumber;
    every time call this method
    for text fields like this,
    OAMessageTextInputBean commval=(OAMessageTextInputBean)webBean.findChildRecursive("commval");
    String lesscomm=commval.getValue(pageContext).toString();
    String lesscommformat=xxformatmask(lesscomm,currency,pageContext);
    float lesscomm1=Float.parseFloat(lesscommformat);
    i got the error at runtimeee
    oracle.apps.fnd.framework.OAException: java.lang.NumberFormatException: For input string: "1,000.00"
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:71)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.lang.NumberFormatException: For input string: "1,000.00"
         at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
         at java.lang.Float.parseFloat(Float.java:394)
         at crm.oracle.apps.xxcrm.crmmgmt.quotationmgmt.server.xxcrmQuotationMgmtAMImpl.forserviceformvalsetting(xxcrmQuotationMgmtAMImpl.java:1994)
         at crm.oracle.apps.xxcrm.crmmgmt.quotationmgmt.webui.xxcrmServiceCostSheetCO.processFormRequest(xxcrmServiceCostSheetCO.java:345)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:71)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • How to Set Pixel Format for AEGP Plugin???

    Hi,
    Does Anyone know how to set pixel format (ARGB or BGRA etc) for After Effect (AEGP) Plugin (Source Generator).

    It requires the Canon Hacker's Developement Kit (CHDK). It runs off of your SD card and does not harm your camera. Download a program called Stick-
    http://zenoshrdlu.com/stick/stick.html
    Follow the directions and you will be able to shoot in RAW along with some other deatures not available on your camera previously.

  • How to convert media format?

    Hi All:
    Does any one know how to convert the media format in JMF?
    Is there any APIs or Demo about how to convert mp3,avi to the uncompressed wav format?
    In windows platform, we can use DirectShow APIs. It's a component of the DirectX SDK. DirectX can help us to decompress the video or audio from compressed format to uncompressed format
    (RGB for video, PCM for audio) and it supports streaming also.
    Is there any familar APIs in JMF or Opensource for Mac?
    Your feedbacks are highly appreciated!
    Best Regards,
    Tango

    Hi,
    You can set the codec chain in the Processor (during configured Stage) object which allow you to define your desired Codec, Multiplexer, etc.
    For more information, you can look at the JMF API Guide. Since I know that JMF doesn't come with mp3 codec, I think you have to download a codec pack called "ffmpeg" etc which add more Codec to JMF.
    About the Mac, I am sorry that I really don't know.
    Best Regards
    Ferdinand Ng

  • How to set date formate dd/mm/yyyy from portal.

    Dear Experts,
    We are implementing ESS/MSS, my query is under ESS applications, date format is showing mm/dd/yyyy, then iam trying to change  user language is English (United Kingdom), from portal end, then its showing dd/mm/yyyy.
    My query is that is there any other way to change date format and how to set user language is English( united Kingdom) for mass users.
    Thanks in advance,
    Regards,
    Mahee.

    Hi,
    Iam trying to upload below format..for mass users....
    [User]
    UID=<employeeid>
    Password=init@123
    FIRST_NAME=xxx
    LAST_NAME=xxx
    group=xxxx
    Language=en_GB
    [User]
    by changing launguage = English (United Kingdom),Now I can able see the require format...dd/mm/yyyy.
    Thanks and Regards,
    Mahee.

  • How to set MQMD format to String through JMS?

    any inputs on how to set the message format (MQFMT) to string (MQSTrforcibly using JMS?
    I have an application which writes a TextMessage to a remote Queue which is being received in MQHRF2 format.
    This needs to be in MQSTR format.

    According to "http://www.share.org/proceedings/sh98/data/S1104.PDF"
    You can do something like
    queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);
    To set the Target as NONJMS client, so that it will accept Text message.
    Hope this helps...

  • How to set Media Encoder to render composition backgrounds

    How do I set media encoder to export compositions with the background color instead of always black?

    That doesn't answer the question - that's a work around.
    Your answer tells me that there is no setting in media encoder to render out my composition without an alpha.  The only way to render without an alpha is to alter my composition to make it compatible with media encoder.
    Seems like a strange way to program your software.

  • How to set paragraph format in Pages?

    I'm a novelist.  I have had trouble setting and maintaining a paragraph format in Pages.  I've manually created a format then copied and pasted that format, but it doesn't maintain the indentations and spacing I want. 
    I've completely left Word, although it's quite easy to set paragraph format and indentation there.
    I want to write my new novel exclusively in Pages.  Can anyone help?
    Tom

    See Chapter 6 of the Pages User Guide PDF. You can download it from the Help menu.
    Once you have mastered Styles, you should be on top of this problem. You may have some specific questions on formatting along the way, and there are lots of experts here to help you.
    Jerry

  • How to set print format what I want in ALV Report

    Hi, guys...
    Let me ask something.
    In AVL Report, I want to set print format when users print list.
    so, I used function 'SET_PRINT_PARAMETERS' on INITIALIZATION Event. but it doesn't work.
    Looks like it works list program(using 'WRITE') only.
    Please, give me some hint^^

    Thanks for the reply...
    But, I want to set print format like 'X_58_170'...
    I call the fuction 'SET_PRINT_PARAMETERS'
    ... example)
      CALL FUNCTION 'SET_PRINT_PARAMETERS'
        EXPORTING
          LAYOUT     = 'X_90_120'
          LINE_COUNT = '55'
          LINE_SIZE  = '110'.
    but, it doesn't work in ALV list program. It only works 'write' list program.
    Give me an answer plz...
    Regards
    Kyung Woo

  • OLE2. How to set cell format to percentage

    hi,
    how can I set the cell format to percentage? I tried with
    ole2.set_property (cell, 'NumberFormat', '%');
    OLE2.set_property(cell, 'Formula', '=A1/B1');
    but this only print a '%' at the end of the cell. Really, the cell format is not percentage, and formula is not calculated.

    solved.
    ole2.set_property (cell, 'NumberFormat', '0,00%');

  • How to set Date format and how to edit

    Hi all,
    I am supposed to select a date from calendar and put the date in a textfield in the format dd/mm/yyyy.
    Getting date from the calendar and putting it in textfield is not a big problem.
    Here I have to edit the date in the text field in such a way that clicking with a mouse on "dd" in the textfield dd part of the textfield should get selected and I should be able to edit date without affecting any other part in the textfield.Similarly clicking on the "mm" of text field,the mm part should get selected and i should be able to edit month without affecting other parts of the textfield and similarly the year field also.Here I should not be able to edit the "/" which is in between dd and mm, mm and yyyy.Is there any date format which i can set to textfield to achieve this.
    pls help me.
    this is urgent
    Thanx

    Can any one tell me how to make part of contents of textbox non editable and rest of the text editable???
    help me pls
    In the above dd/mm/yyyy format, "/" should be non editable and rest of the fields should be editable but can't be deleted.
    is it possible to achieve this...
    Pls respond............

  • How to set date format dd.MM.yy for chart time axis

    Is it possible to set default date format dd.MM.yy instead of MM/dd/yy in Flex charts without using label function ?
    In this case we do not know beforehand the length of the time span; it can be minutes, days or weeks.
    Setting locales in compiler options or locale settings for application seems not having any effect.

    For example
    - mx:Barchar
    - if time span is 4 minutes; time axis format is HH:mm and shows 10:00, 10:01, 10:02, 10:03 ; *this correct*
    - if time span is 5 days; time labels are automatically in MM/dd/yy format; question is how to change this automation
    to format dd.MM.yy
    - how to do this *without* dateformatter and *without* coding "if time span is is longer than day nyt less than week then use dd.MM.yy format" ?

  • How to set Page Format in adobe form

    Hi,
    I am designing a simple print forn using Adobe, since printer is dotmatrix page break should be triggered longer then usual A4 size.
    If I do the same thing using Smartfom I will define a page format and under output type of the smartform I will assign it, this is enough to tell the system what is the length and width of the page I am using for printing.
    how can we achive this in adobe form.
    Regards
    Bikas

    Hello,
    go to your master page and change the master page/page format/size as you wish.
    Otto

Maybe you are looking for