In C i have:
Code:
constchar*Encoder_av_get_media_type_string(enumAVMediaType 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 the header file which connect between the C and the CLI i have:
Code:
constchar*Encoder_av_get_media_type_string(enumAVMediaType media_type);
Then in the CLI i have:
Code:
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:
Code:
List<string> ss =newList<string>();for(int i =0; i < f.GetCodec.Count; i++){ ss.Add(f.GetCodec[i]);}
But in the end also in CLI and also in CSHARP i'm getting one type i see in CSHARP that the variable ss contain only "video" i want it to contain all the other 6 types too.
How can i do it ?
Later i have edited my question so i think this edited part is the one i need solution for:
I changed the type of the function in the cli to List<String^> type:
Code:
List<String^>^GetCodecsTypes(){List<String^>^l = gcnew List<String^>;String^s; s = gcnew String(Encoder_av_get_media_type_string();return l;}
I'm not sure what i should put in the () of the: Encoder_GetCurrentCodecName()
It should get: AVMediaType media_type
Then in Csharp this is my button1 click event code:
Code:
privatevoid button1_Click(object sender,EventArgs e){ f =newFFMPEGWrapper();List<FFMPEGWrapper> l = f.GetCodecs();var video_codecs = l.Where(w => w.CodecType==0);var audio_codecs = l.Where(w => w.CodecType==1);List<string> names =new[]{"***Video Codecs***"}.Concat(video_codecs.Select(w => w.CodecName)).Concat(new[]{"***Audio Codecs***"}).Concat(audio_codecs.Select(w => w.CodecName)).ToList();
So i want to use it like: List<String> s = f.GetCodecsTypes();
But i dont know how to make it right in the CLI file and in the C file.
In the C file i didn;t change anything it's still as it was before:
Code:
constchar*Encoder_av_get_media_type_string(enumAVMediaType 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;}}
In the end in Csharp i want that the variable s will contain all the types names.
And maybe if it's possible i wanted to do it in the CLI or even in the C file that it will return all the types names without doing it manualy like it is now in C to return each type but to return a List of all the types to csharp.
But first i don't know yet how to send it in the first time all the types names to Csharp.