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

Commit 6f505a4c authored by Lajos Molnar's avatar Lajos Molnar
Browse files

MediaMuxer: Remove SAMPLE_FLAG_SYNC flag



MediaMuxer.writeSampleData() uses MediaCodec.BufferInfo
objects to specify the flags, so use directly the MediaCodec
flags.  This is more intuitive and avoids users of the
MediaMuxer API having to create translations between
MediaMuxer's and MediaCodec's flag constants.

Change-Id: I18e12a6839ffb2c63da62516a4dc4c94e8bb3d17
Signed-off-by: default avatarLajos Molnar <lajos@google.com>
Bug: 9169479
parent 6f6b31da
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -40,12 +40,6 @@ struct MPEG4Writer;
// deleting the output file after stop.
// deleting the output file after stop.
struct MediaMuxer : public RefBase {
struct MediaMuxer : public RefBase {
public:
public:
    // Please update media/java/android/media/MediaMuxer.java if the
    // SampleFlags is updated.
    enum SampleFlags {
        SAMPLE_FLAG_SYNC = 1,
    };

    // Please update media/java/android/media/MediaMuxer.java if the
    // Please update media/java/android/media/MediaMuxer.java if the
    // OutputFormat is updated.
    // OutputFormat is updated.
    enum OutputFormat {
    enum OutputFormat {
+1 −1
Original line number Original line Diff line number Diff line
@@ -161,7 +161,7 @@ status_t MediaMuxer::writeSampleData(const sp<ABuffer> &buffer, size_t trackInde
    // Just set the kKeyDecodingTime as the presentation time for now.
    // Just set the kKeyDecodingTime as the presentation time for now.
    sampleMetaData->setInt64(kKeyDecodingTime, timeUs);
    sampleMetaData->setInt64(kKeyDecodingTime, timeUs);


    if (flags & SAMPLE_FLAG_SYNC) {
    if (flags & MediaCodec::BUFFER_FLAG_SYNCFRAME) {
        sampleMetaData->setInt32(kKeyIsSyncFrame, true);
        sampleMetaData->setInt32(kKeyIsSyncFrame, true);
    }
    }