Project

General

Profile

Actions

Support Request #7981

closed

How to get SampleTypeName

Added by hidden over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Customer:
DIGITEQ
Department:
Requester's Priority:
Normal
Support Level:
2nd Level
Resolution:
Solved Issue
Product Issue Numbers:
Affected Products:
Platform:
Topic:
ADTF::FilterSDK
FAQ Links:

Description

Supportanfrage

Sorry, I did not find any function that can readback "strSampleTypeName". Please help how to get this value.

The only workaround seems to me to have same pin name and sample type name and it is not good.

        // Set typing for output pin
          ucom::cObjectPtr<adtf::IMediaType> pType = NULL;
          RETURN_IF_FAILED(m_oOutputEnvironment.GetMediaType(&pType));
          ucom::cObjectPtr<adtf::IMediaTypeDescription> pTypeDescription = NULL;
          if(IS_OK(pType->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&pTypeDescription)))
          {
            //if you are not sure your description works! 
            //react on this return value!
            RETURN_IF_FAILED(pTypeDescription->SetMediaSampleDescription("tVehicleModelEnvironment",        //strTypeName,
                                                                         strMyDescription.GetPtr(),
                                                                         IMediaDescription::MDF_DDL020000));
          }

(I will be on vacation till 11.8. so no response needed sooner)

Lösung

Just hit pTypeDescription->GetMediaSampleName to retreive SampleTypeName

For an example please have a look at Demo Qt Media Description Display Filter to adapt for your use case.


Files

VehicleModelOutputBehaviour.cpp (34.1 KB) VehicleModelOutputBehaviour.cpp Please note MediaSampleDescription from source hidden, 2019-08-12 11:39
Actions #1

Updated by hidden over 4 years ago

  • Project changed from Public Support to 27
  • Status changed from New to In Progress
  • Topic set to ADTF::FilterSDK
  • Customer set to DIGITEQ
Actions #2

Updated by hidden over 4 years ago

  • Status changed from In Progress to Customer Feedback Required

Hi Jaroslav,

I am not sure what you really want to do and if I understand the use case by far, but with

pTypeDescription->GetMediaSampleDescription you can read it out again.

Just define your IMediaTypeDescription Pointer as private class member instead of scope above -> than you can access anywhere.

Just have a look at our examples, they will define it that way

Actions #3

Updated by hidden over 4 years ago

Unfortunatelly const tChar* GetMediaSampleDescription(); cannot read SampleTypeName. So this function is useless. I need to get SampleTypeName from another filter, when IMediaTypeDescription can be obtained.

Please note that SampleTypeName is NOT MediaSampleDescription. Sample type name is a structure inside Media sample description.

/** protect the @ref IMediaTypeDescription to sets the media sample description. 
      * 
      * If the strSampleTypeName is set to "tMySampleTypeName" and the description of this type is within
      * strSampleTypeDescription the description will look like:
      *
      * \code 
      * <stream name="generated_name" type="tMyMediaTypeName">
      *    <struct type="tMySampleTypeName" bytepos="0"/>
      * </stream>
      * \endcode
      * 
      * @copydoc IMediaTypeDescription::SetMediaSampleDescription
      * @attention This implementation can only handle descriptions with one struct (complex type) within stream.
      *            To use more than one complex type you need to define a complex type with you complex types as elements.
      */
      tResult SetMediaSampleDescription(const tChar* strSampleTypeName,
                                          const tChar* strSampleTypeDescription, 
                                          ucom::IException** __exception_ptr=NULL);
Actions #5

Updated by hidden over 4 years ago

Hi Jaroslav,

sorry for missunderstanding your achievement...

Just hit pTypeDescription->GetMediaSampleName to retreive SampleTypeName

For an example please have a look at Demo Qt Media Description Display Filter to adapt for your use case.

Actions #6

Updated by hidden over 4 years ago

Thanks it is OK, you could close this ticket.

Please update your comment in ADTF headers to make clear that "_MediaSampleName_" equals "_SampleTypeName_".

Actions #7

Updated by hidden over 4 years ago

  • Project changed from 27 to Public Support
  • Subject changed from Please help me, how to read back "SampleTypeName" to How to get SampleTypeName
  • Description updated (diff)
  • Status changed from Customer Feedback Required to To Be Closed
  • Private changed from Yes to No
  • Resolution set to Solved Issue

Thanks for feedback, there is no new release in adtf 2.x universe planned so this will be a known issue so far

Actions #8

Updated by hidden almost 4 years ago

  • Status changed from To Be Closed to Closed
Actions

Also available in: Atom PDF