Skip to content

Commit

Permalink
Added support for MPEG2 video in MPEG4Extractor
Browse files Browse the repository at this point in the history
Change-Id: I70b1c3a07062526fc6d5333f70f4f1d792834e7f
  • Loading branch information
harishdm authored and medialajos committed May 5, 2015
1 parent 8b07404 commit ae0c0a1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion media/libstagefright/MPEG4Extractor.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,18 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
return err;
}
}

if (mPath.size() >= 2
&& mPath[mPath.size() - 2] == FOURCC('m', 'p', '4', 'v')) {
// Check if the video is MPEG2
ESDS esds(&buffer[4], chunk_data_size - 4);

uint8_t objectTypeIndication;
if (esds.getObjectTypeIndication(&objectTypeIndication) == OK) {
if (objectTypeIndication >= 0x60 && objectTypeIndication <= 0x65) {
mLastTrack->meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_MPEG2);
}
}
}
break;
}

Expand Down Expand Up @@ -2830,6 +2841,7 @@ status_t MPEG4Extractor::verifyTrack(Track *track) {
return ERROR_MALFORMED;
}
} else if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_MPEG4)
|| !strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_MPEG2)
|| !strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) {
if (!track->meta->findData(kKeyESDS, &type, &data, &size)
|| type != kTypeESDS) {
Expand Down

0 comments on commit ae0c0a1

Please sign in to comment.