H264_CONTEXT* h264_context_new(BOOL Compressor)
{
++<<<<<<< HEAD
++ H264_CONTEXT* h264;
++=======
+ long status;
H264_CONTEXT* h264;
+ SDecodingParam sDecParam;
+ static EVideoFormatType videoFormat = videoFormatI420;
++>>>>>>> 5c5386fe042de2a638a03e856afa3ec89f9d1a12
h264 = (H264_CONTEXT*) calloc(1, sizeof(H264_CONTEXT));
{
h264->Compressor = Compressor;
++<<<<<<< HEAD
+#ifdef WITH_OPENH264
++=======
+ WelsCreateDecoder(&h264->pDecoder);
+
+ if (!h264->pDecoder)
+ {
+ printf("Failed to create OpenH264 decoder\n");
+ goto EXCEPTION;
+ }
+
+ ZeroMemory(&sDecParam, sizeof(sDecParam));
+ sDecParam.iOutputColorFormat = videoFormatARGB;
+ status = (*h264->pDecoder)->Initialize(h264->pDecoder, &sDecParam);
+
+ if (status != 0)
+ {
+ printf("Failed to initialize OpenH264 decoder (status=%ld)\n", status);
+ goto EXCEPTION;
+ }
+
+ status = (*h264->pDecoder)->SetOption(h264->pDecoder, DECODER_OPTION_DATAFORMAT, &videoFormat);
+
+ if (status != 0)
++>>>>>>> 5c5386fe042de2a638a03e856afa3ec89f9d1a12
{
- printf("Failed to set data format option on OpenH264 decoder (status=%ld)\n", status);
+ static EVideoFormatType videoFormat = videoFormatI420;
+
+ SDecodingParam sDecParam;
+ long status;
+
+ WelsCreateDecoder(&h264->pDecoder);
+
+ if (!h264->pDecoder)
+ {
+ printf("Failed to create OpenH264 decoder\n");
+ goto EXCEPTION;
+ }
+
+ ZeroMemory(&sDecParam, sizeof(sDecParam));
+ sDecParam.iOutputColorFormat = videoFormatARGB;
+ status = (*h264->pDecoder)->Initialize(h264->pDecoder, &sDecParam);
+ if (status != 0)
+ {
+ printf("Failed to initialize OpenH264 decoder (status=%ld)\n", status);
+ goto EXCEPTION;
+ }
+
+ status = (*h264->pDecoder)->SetOption(h264->pDecoder, DECODER_OPTION_DATAFORMAT, &videoFormat);
+ if (status != 0)
+ {
+ printf("Failed to set data format option on OpenH264 decoder (status=%ld)\n", status);
+ }
}
+#endif
h264_context_reset(h264);
}