@@ -30,9 +30,12 @@ Cisco's OpenH264 C++/CLI wrapper with optimised image format conversion support.
3030 {
3131 foreach (var frame in frames )
3232 {
33- // hints..
33+ // You can convert to managed array
3434 // byte[] b = frame.ToByteArray();
35+
36+ // You can copy to Managed array
3537 // frame.CopyTo(buffer, 0);
38+
3639 Decode (frame .Data , frame .Length , frame .Type );
3740 }
3841 }
@@ -45,18 +48,20 @@ Cisco's OpenH264 C++/CLI wrapper with optimised image format conversion support.
4548``` C#
4649 void Decode (IntPtr data , int length , FrameType type )
4750 {
48- // if (decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out RgbImage rgb))
49- // if (decoder.Decode(data, length, noDelay:true, out DecodingState statusCode, out Yuv420p yuv420))
5051 if (decoder .Decode (data , length , noDelay :true , out DecodingState statusCode , out Bitmap bmp ))
5152 {
5253 // Do stuff..
5354 // bmp.Save("t.bmp");
5455 }
5556 }
57+ // You can use other formats as:
58+ decoder .Decode (data , length , noDelay :true , out DecodingState statusCode , out RgbImage rgb )
59+ decoder .Decode (data , length , noDelay :true , out DecodingState statusCode , out Yuv420p yuv420 )
60+ .. .
5661```
5762
5863# Converter dll
59- A separate dll is provided for RGB <-> YUV conversions. Its compiled with clang LLVM and has AVX2 intrinsics.
64+ A separate dll is provided for RGB <-> YUV conversions. Its compiled with clang LLVM with AVX2 intrinsics.
6065</br >You can optionally include it on your executable path just like Openh264 dll.
6166</br >
6267</br >If wrapper cannot find the Converter32/64 dll or if your machine does not support AVX2 it will fall back to use default C++/Cli versions.
@@ -69,6 +74,7 @@ A separate dll is provided for RGB <-> YUV conversions. Its compiled with clang
6974- Keep the original names if you want to use default constructors.
7075- Optionally Add Converter64/32 dlls to your executable directory same way as openh264 dll.
7176- Enjoy
77+
7278# Remarks
7379- Decode callbacks with raw image formats use cached back buffer, if you wont consume them immediately, make a copy or sync your system.
7480- Encoder output "EncodedFrame" uses cached back buffer, if you wont consume them immediately, make a copy or sync your system.
0 commit comments