else if (self->codec_type == CT_VC1_SM)
{
const GValue *codec_data = gst_structure_get_value(structure, "codec_data");
if (codec_data)
{
guint8 *data;
video_codec_data_t videocodecdata;
gint width, height;
gint codec_size = GST_BUFFER_SIZE(gst_value_get_buffer(codec_data));
if (codec_size > 4) codec_size = 4;
gst_structure_get_int(structure, "width", &width);
gst_structure_get_int(structure, "height", &height);
videocodecdata.length = 33;
data = videocodecdata.data = (guint8*)g_malloc(videocodecdata.length);
memset(data, 0, videocodecdata.length);
data += 18;
/* width */
*(data++) = (width >> 8) & 0xff;
*(data++) = width & 0xff;
/* height */
*(data++) = (height >> 8) & 0xff;
*(data++) = height & 0xff;
if (codec_data && codec_size) memcpy(data, GST_BUFFER_DATA(gst_value_get_buffer(codec_data)), codec_size);
ioctl(self->fd, VIDEO_SET_CODEC_DATA, &videocodecdata);
g_free(videocodecdata.data);
}
}
....
if (codec_size > 4) codec_size = 4;
if (codec_data && codec_size) memcpy(data, GST_BUFFER_DATA(gst_value_get_buffer(codec_data)), codec_size);
No idea why this is done
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916