i have function in c
int encoder_getcurrentcodectype() { if (current_codec != null) return (int) current_codec->type; return avmedia_type_unknown; }
but function return code of each codec type. like: 0,1,2,3,4,5,6,7
if i'm doing test in function type: avmediatype::
see list of 7 codec's types there example:
avmedia_type_audio
so want make function 1 int string
or const char*
return me names of types , not codes.
how can ?
edit
in c file did:
const char* encoder_av_get_media_type_string(enum avmediatype media_type) { switch (media_type) { case avmedia_type_video: return "video"; case avmedia_type_audio: return "audio"; case avmedia_type_data: return "data"; case avmedia_type_subtitle: return "subtitle"; case avmedia_type_attachment: return "attachment"; default: return null; } }
then in header file connecting between c , c++ did:
const char* encoder_av_get_media_type_string(enum avmediatype media_type);
then in c++ header file did:
property list<string^> ^getcodec { list<string^>^ get() { list<string^> ^l = gcnew list<string^>; string ^s; s = gcnew string(encoder_av_get_media_type_string(avm)); l->add(s); return l; } }
then in csharp did:
for (int = 0; < f.getcodec.count; i++) { ss.add(f.getcodec[i]); }
so maybe in c++ shouldn't property thought in csharp when make f.getcodec. show me list of codec's types names.
like property when i'm doing f.getcodec.add , see list of properties f.getcodec.(and here list of types names)
if it's impossible make in csharp list types names.
but i'm getting 1 name "video" that's it.
according this, there exists function that.
const char* av_get_media_type_string(enum avmediatype media_type)
Comments
Post a Comment