I have made a directshow filter of decoder using libde265. There is built in function named write_image. It writes the decoded data in a yuv file.
I need to render the decoder data. For that purpose I need to do two steps: Output data on the output pin Conversion of the data into rgb format
The media_subtype used is IMC3. IN IMC3 the format of the data is , y components following u and v in the memory .
I have tried the following code to output the data on the pin.
static FILE* fh = NULL;
if (fh == NULL) { fh = fopen(output_filename, "wb"); }
for (int y = 0; y<de265_get_image_height(img, 0); y++)
fread(out, de265_get_image_width(img, 0), 1, fh);
for (int y = 0; y<de265_get_image_height(img, 1); y++)
fread(out, de265_get_image_width(img, 1), 1, fh);
for (int y = 0; y<de265_get_image_height(img, 2); y++)
fread(out, de265_get_image_width(img, 2), 1, fh);
But the render screen is blank. Secondly I need to convert it to rgb as well. In the above code img is the image structure storing the decoded data.
Please help me in this regard because render is not showing anything. As well as suggest me to convert the data in the rgb format as well. May be I may be wrong in packing the data in the output buffer.Although I am following the exact IMC3 format