qtdemux: Don't retrieve video stsd entry multiple times
And remove various duplicated checks. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
This commit is contained in:
parent
af5cce9968
commit
fec61cc546
@ -14501,7 +14501,6 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
GNode *stbl;
|
GNode *stbl;
|
||||||
GNode *stsd;
|
GNode *stsd;
|
||||||
GNode *mp4a;
|
GNode *mp4a;
|
||||||
GNode *mp4v;
|
|
||||||
GNode *esds;
|
GNode *esds;
|
||||||
GNode *tref;
|
GNode *tref;
|
||||||
GNode *udta;
|
GNode *udta;
|
||||||
@ -14930,31 +14929,10 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
GST_LOG_OBJECT (qtdemux, "frame count: %u",
|
GST_LOG_OBJECT (qtdemux, "frame count: %u",
|
||||||
QT_UINT16 (stsd_entry_data + offset + 32));
|
QT_UINT16 (stsd_entry_data + offset + 32));
|
||||||
|
|
||||||
esds = NULL;
|
esds = qtdemux_tree_get_child_by_type (stsd_entry, FOURCC_esds);
|
||||||
pasp = NULL;
|
pasp = qtdemux_tree_get_child_by_type (stsd_entry, FOURCC_pasp);
|
||||||
colr = NULL;
|
colr = qtdemux_tree_get_child_by_type (stsd_entry, FOURCC_colr);
|
||||||
fiel = NULL;
|
fiel = qtdemux_tree_get_child_by_type (stsd_entry, FOURCC_fiel);
|
||||||
/* pick 'the' stsd child */
|
|
||||||
mp4v = qtdemux_tree_get_child_by_index (stsd, stsd_index);
|
|
||||||
// We should skip parsing the stsd for non-protected streams if
|
|
||||||
// the entry doesn't match the fourcc, since they don't change
|
|
||||||
// format. However, for protected streams we can have partial
|
|
||||||
// encryption, where parts of the stream are encrypted and parts
|
|
||||||
// not. For both parts of such streams, we should ensure the
|
|
||||||
// esds overrides are parsed for both from the stsd.
|
|
||||||
if (QTDEMUX_TREE_NODE_FOURCC (mp4v) != fourcc) {
|
|
||||||
if (stream->protected && QTDEMUX_TREE_NODE_FOURCC (mp4v) != FOURCC_encv)
|
|
||||||
mp4v = NULL;
|
|
||||||
else if (!stream->protected)
|
|
||||||
mp4v = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mp4v) {
|
|
||||||
esds = qtdemux_tree_get_child_by_type (mp4v, FOURCC_esds);
|
|
||||||
pasp = qtdemux_tree_get_child_by_type (mp4v, FOURCC_pasp);
|
|
||||||
colr = qtdemux_tree_get_child_by_type (mp4v, FOURCC_colr);
|
|
||||||
fiel = qtdemux_tree_get_child_by_type (mp4v, FOURCC_fiel);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pasp) {
|
if (pasp) {
|
||||||
const guint8 *pasp_data = (const guint8 *) pasp->data;
|
const guint8 *pasp_data = (const guint8 *) pasp->data;
|
||||||
@ -15245,8 +15223,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
GST_FOURCC_ARGS (fourcc));
|
GST_FOURCC_ARGS (fourcc));
|
||||||
|
|
||||||
/* codec data might be in glbl extension atom */
|
/* codec data might be in glbl extension atom */
|
||||||
glbl = mp4v ?
|
glbl = qtdemux_tree_get_child_by_type (stsd_entry, FOURCC_glbl);
|
||||||
qtdemux_tree_get_child_by_type (mp4v, FOURCC_glbl) : NULL;
|
|
||||||
if (glbl) {
|
if (glbl) {
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user