News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

C Macro to translate

Started by TouEnMasm, August 13, 2020, 12:20:40 AM

Previous topic - Next topic

TouEnMasm

Hello,
I need help to translate two C macros providing media GUID
Quote
;----------------- manuel translation of a sort of MACRO -------------------------------------------
;#define DEFINE_MEDIATYPE_GUID(name, format) \
;    DEFINE_GUID(name,                       \
;    format, 0x0000, 0x0010,   0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);     11 data
;--------------------------- Manual soluce  sample ------------------------------------------------
;declare
; sMFVideoFormat_RGB32 TEXTEQU  <{D3DFMT_X8R8G8B8h,0000h,010h,{080h,000h,000h,0AAh,00h,038h,09bh,071h}}>
; en data
; MFVideoFormat_RGB32 GUID sMFVideoFormat_RGB32
;-------------------------------- autre macro -------------------------------------------------------------
;#define FCC(ch4) ((((DWORD)(ch4) & 0xFF) << 24) |     \
;                 (((DWORD)(ch4) & 0xFF00) << 8) |    \
;                  (((DWORD)(ch4) & 0xFF0000) >> 8) |  \
;                  (((DWORD)(ch4) & 0xFF000000) >> 24))
;---------------------------------- a traduire ------------------------------------------------------------------------
comment µ
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Base,      0x00000000 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_RGB32,     D3DFMT_X8R8G8B8 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_ARGB32,    D3DFMT_A8R8G8B8 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_RGB24,     D3DFMT_R8G8B8 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_RGB555,    D3DFMT_X1R5G5B5 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_RGB565,    D3DFMT_R5G6B5 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_RGB8,      D3DFMT_P8 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_L8,        D3DFMT_L8 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_L16,       D3DFMT_L16 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_D16,       D3DFMT_D16 );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_AI44,      FCC('AI44') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_AYUV,      FCC('AYUV') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_YUY2,      FCC('YUY2') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_YVYU,      FCC('YVYU') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_YVU9,      FCC('YVU9') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_UYVY,      FCC('UYVY') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_NV11,      FCC('NV11') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_NV12,      FCC('NV12') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_YV12,      FCC('YV12') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_I420,      FCC('I420') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_IYUV,      FCC('IYUV') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Y210,      FCC('Y210') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Y216,      FCC('Y216') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Y410,      FCC('Y410') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Y416,      FCC('Y416') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Y41P,      FCC('Y41P') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Y41T,      FCC('Y41T') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_Y42T,      FCC('Y42T') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_P210,      FCC('P210') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_P216,      FCC('P216') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_P010,      FCC('P010') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_P016,      FCC('P016') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_v210,      FCC('v210') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_v216,      FCC('v216') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_v410,      FCC('v410') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_MP43,      FCC('MP43') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_MP4S,      FCC('MP4S') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_M4S2,      FCC('M4S2') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_MP4V,      FCC('MP4V') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_WMV1,      FCC('WMV1') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_WMV2,      FCC('WMV2') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_WMV3,      FCC('WMV3') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_WVC1,      FCC('WVC1') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_MSS1,      FCC('MSS1') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_MSS2,      FCC('MSS2') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_MPG1,      FCC('MPG1') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_DVSL,      FCC('dvsl') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_DVSD,      FCC('dvsd') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_DVHD,      FCC('dvhd') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_DV25,      FCC('dv25') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_DV50,      FCC('dv50') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_DVH1,      FCC('dvh1') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_DVC,       FCC('dvc ') );
DEFINE_MEDIATYPE_GUID( MFVideoFormat_H264,      FCC('H264') );  // assume MFVideoFormat_H264 is frame

Searching a little,there is more to translate.
Those GUID are needed to use the Media foundation,https://docs.microsoft.com/en-us/windows/win32/medfound/how-to-play-unprotected-media-files
in the attachment is a working sample of what can be done (microsoft c++ sample)
pass it this URL http://direct.franceculture.fr/live/franceculture-midfi.mp3
Fa is a musical note to play with CL

guga

MFVideoFormat_Base    Guid    00000000-0000-0010-8000-00aa00389b71
MFVideoFormat_RGB32    Guid    00000016-0000-0010-8000-00aa00389b71
MFVideoFormat_ARGB32    Guid    00000015-0000-0010-8000-00aa00389b71
MFVideoFormat_RGB24    Guid    00000014-0000-0010-8000-00aa00389b71
MFVideoFormat_RGB555    Guid    00000018-0000-0010-8000-00aa00389b71
MFVideoFormat_RGB565    Guid    00000017-0000-0010-8000-00aa00389b71
MFVideoFormat_RGB8    Guid    00000029-0000-0010-8000-00aa00389b71
MFVideoFormat_L8    Guid    00000032-0000-0010-8000-00aa00389b71
MFVideoFormat_L16    Guid    00000051-0000-0010-8000-00aa00389b71
MFVideoFormat_D16    Guid    00000050-0000-0010-8000-00aa00389b71
MFVideoFormat_AI44    Guid    34344941-0000-0010-8000-00aa00389b71
MFVideoFormat_AYUV    Guid    56555941-0000-0010-8000-00aa00389b71
MFVideoFormat_YUY2    Guid    32595559-0000-0010-8000-00aa00389b71
MFVideoFormat_YVYU    Guid    55595659-0000-0010-8000-00aa00389b71
MFVideoFormat_YVU9    Guid    39555659-0000-0010-8000-00aa00389b71
MFVideoFormat_H264    Guid    34363248-0000-0010-8000-00aa00389b71
MFVideoFormat_UYVY    Guid    59565955-0000-0010-8000-00aa00389b71

The others you can search here. No need for translation, just paste the name of the guid and set the checkboxes of the site to "Index+Name+Type+Value" and voilá  :thumbsup: :thumbsup: :thumbsup:

https://www.magnumdb.com/search?q=MFVideoFormat_UYVY


Once, you have done, please post for us too  :azn: :azn: :azn:
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

nidud

#2
deleted

TouEnMasm


Thanks for anwers.
I will try to made with all that.
I have try to made c++ translate this for me,but i have not the correct syntax.

for example:
Quote
const IID MFBase = MFVideoFormat_RGB24;

LPCSTR  phrase[300];
                     
int cdecl wmain ( int argc, char *argv[ ], char *envp[ ] )
{   
   
   StringFromGUID2(MFBase,(LPOLESTR)phrase,sizeof(phrase));
    printf(*phrase);
   // copier coller ici
   _getch();
answer by link   error LNK2019: symbole externe non r,solu _MFVideoFormat_RGB24


Fa is a musical note to play with CL

TouEnMasm


Here the soluce i have used in c++ and command line,less difficult than VS.

VC command line: /c /FA /Gm- /GS- /Ox /MD

Quote
MFVideoFormat_Base    {00000000-0000-0010-8000-00AA00389B71}
MFVideoFormat_RGB32    {00000016-0000-0010-8000-00AA00389B71}
MFVideoFormat_ARGB32    {00000015-0000-0010-8000-00AA00389B71}
MFVideoFormat_RGB24    {00000014-0000-0010-8000-00AA00389B71}
MFVideoFormat_RGB555    {00000018-0000-0010-8000-00AA00389B71}
MFVideoFormat_RGB565    {00000017-0000-0010-8000-00AA00389B71}
MFVideoFormat_RGB8    {00000029-0000-0010-8000-00AA00389B71}
MFVideoFormat_L8    {00000032-0000-0010-8000-00AA00389B71}
MFVideoFormat_L16    {00000051-0000-0010-8000-00AA00389B71}
MFVideoFormat_D16    {00000050-0000-0010-8000-00AA00389B71}
MFVideoFormat_AI44    {34344941-0000-0010-8000-00AA00389B71}
MFVideoFormat_AYUV    {56555941-0000-0010-8000-00AA00389B71}
MFVideoFormat_YUY2    {32595559-0000-0010-8000-00AA00389B71}
MFVideoFormat_YVYU    {55595659-0000-0010-8000-00AA00389B71}
MFVideoFormat_YVU9    {39555659-0000-0010-8000-00AA00389B71}
MFVideoFormat_UYVY    {59565955-0000-0010-8000-00AA00389B71}
MFVideoFormat_NV11    {3131564E-0000-0010-8000-00AA00389B71}
MFVideoFormat_NV12    {3231564E-0000-0010-8000-00AA00389B71}
MFVideoFormat_YV12    {32315659-0000-0010-8000-00AA00389B71}
MFVideoFormat_I420    {30323449-0000-0010-8000-00AA00389B71}
MFVideoFormat_IYUV    {56555949-0000-0010-8000-00AA00389B71}
MFVideoFormat_Y210    {30313259-0000-0010-8000-00AA00389B71}
MFVideoFormat_Y216    {36313259-0000-0010-8000-00AA00389B71}
MFVideoFormat_Y410    {30313459-0000-0010-8000-00AA00389B71}
MFVideoFormat_Y416    {36313459-0000-0010-8000-00AA00389B71}
MFVideoFormat_Y41P    {50313459-0000-0010-8000-00AA00389B71}
MFVideoFormat_Y41T    {54313459-0000-0010-8000-00AA00389B71}
MFVideoFormat_Y42T    {54323459-0000-0010-8000-00AA00389B71}
MFVideoFormat_P210    {30313250-0000-0010-8000-00AA00389B71}
MFVideoFormat_P216    {36313250-0000-0010-8000-00AA00389B71}
MFVideoFormat_P010    {30313050-0000-0010-8000-00AA00389B71}
MFVideoFormat_P016    {36313050-0000-0010-8000-00AA00389B71}
MFVideoFormat_v210    {30313276-0000-0010-8000-00AA00389B71}
MFVideoFormat_v216    {36313276-0000-0010-8000-00AA00389B71}
MFVideoFormat_v410    {30313476-0000-0010-8000-00AA00389B71}
MFVideoFormat_MP43    {3334504D-0000-0010-8000-00AA00389B71}
MFVideoFormat_MP4S    {5334504D-0000-0010-8000-00AA00389B71}
MFVideoFormat_M4S2    {3253344D-0000-0010-8000-00AA00389B71}
MFVideoFormat_MP4V    {5634504D-0000-0010-8000-00AA00389B71}
MFVideoFormat_WMV1    {31564D57-0000-0010-8000-00AA00389B71}
MFVideoFormat_WMV2    {32564D57-0000-0010-8000-00AA00389B71}
MFVideoFormat_WMV3    {33564D57-0000-0010-8000-00AA00389B71}
MFVideoFormat_WVC1    {31435657-0000-0010-8000-00AA00389B71}
MFVideoFormat_MSS1    {3153534D-0000-0010-8000-00AA00389B71}
MFVideoFormat_MSS2    {3253534D-0000-0010-8000-00AA00389B71}
MFVideoFormat_MPG1    {3147504D-0000-0010-8000-00AA00389B71}
MFVideoFormat_DVSL    {6C737664-0000-0010-8000-00AA00389B71}
MFVideoFormat_DVSD    {64737664-0000-0010-8000-00AA00389B71}
MFVideoFormat_DVHD    {64687664-0000-0010-8000-00AA00389B71}
MFVideoFormat_DV25    {35327664-0000-0010-8000-00AA00389B71}
MFVideoFormat_DV50    {30357664-0000-0010-8000-00AA00389B71}
MFVideoFormat_DVH1    {31687664-0000-0010-8000-00AA00389B71}
MFVideoFormat_DVC    {20637664-0000-0010-8000-00AA00389B71}
MFVideoFormat_H264    {34363248-0000-0010-8000-00AA00389B71}
MFVideoFormat_H265    {35363248-0000-0010-8000-00AA00389B71}
MFVideoFormat_MJPG    {47504A4D-0000-0010-8000-00AA00389B71}
MFVideoFormat_420O    {4F303234-0000-0010-8000-00AA00389B71}
MFVideoFormat_HEVC    {43564548-0000-0010-8000-00AA00389B71}
MFVideoFormat_HEVC_ES    {53564548-0000-0010-8000-00AA00389B71}
MFVideoFormat_VP80    {30385056-0000-0010-8000-00AA00389B71}
MFVideoFormat_VP90    {30395056-0000-0010-8000-00AA00389B71}
MFVideoFormat_ORAW    {5741524F-0000-0010-8000-00AA00389B71}

Fa is a musical note to play with CL