Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe84cf13 authored by James Dong's avatar James Dong
Browse files

Make available h263 DSI information from MPEG4Extractor

bug - 3446863

Change-Id: Idbaf7a564d544784fdbc36ed0339c98a519adc88
parent 4c030b56
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ enum {
    kKeyBitRate           = 'brte',  // int32_t (bps)
    kKeyESDS              = 'esds',  // raw data
    kKeyAVCC              = 'avcc',  // raw data
    kKeyD263              = 'd263',  // raw data
    kKeyVorbisInfo        = 'vinf',  // raw data
    kKeyVorbisBooks       = 'vboo',  // raw data
    kKeyWantsNALFragments = 'NALf',
@@ -118,6 +119,7 @@ enum {
enum {
    kTypeESDS        = 'esds',
    kTypeAVCC        = 'avcc',
    kTypeD263        = 'd263',
};

class MetaData : public RefBase {
+24 −0
Original line number Diff line number Diff line
@@ -1164,6 +1164,30 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
            break;
        }

        case FOURCC('d', '2', '6', '3'):
        {
            // d263 contains fixed 7 bytes:
            // vendor - 4 bytes
            // version - 1 byte
            // level - 1 byte
            // profile - 1 byte
            char buffer[7];
            if (chunk_data_size != (off64_t) sizeof(buffer)) {
                LOGE("Incorrect D263 box size %lld", chunk_data_size);
                return ERROR_MALFORMED;
            }

            if (mDataSource->readAt(
                    data_offset, buffer, chunk_data_size) < chunk_data_size) {
                return ERROR_IO;
            }

            mLastTrack->meta->setData(kKeyD263, kTypeD263, buffer, chunk_data_size);

            *offset += chunk_size;
            break;
        }

        case FOURCC('m', 'e', 't', 'a'):
        {
            uint8_t buffer[4];