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

Commit ecc08401 authored by Gloria Wang's avatar Gloria Wang Committed by Android (Google) Code Review
Browse files

Merge "For out of band timed text support (timed text in a separate file)."

parents ade8c2d6 965d08ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ enum media_player_states {

enum media_set_parameter_keys {
    KEY_PARAMETER_TIMED_TEXT_TRACK_INDEX = 1000,
    KEY_PARAMETER_TIMED_TEXT_ADD_OUT_OF_BAND_SOURCE = 1001,
};
// ----------------------------------------------------------------------------
// ref-counted object for callbacks
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ LOCAL_SRC_FILES:= \
        ThrottledSource.cpp               \
        TimeSource.cpp                    \
        TimedEventQueue.cpp               \
        TimedTextPlayer.cpp               \
        Utils.cpp                         \
        VBRISeeker.cpp                    \
        WAVExtractor.cpp                  \
@@ -89,6 +88,7 @@ LOCAL_STATIC_LIBRARIES := \
        libstagefright_avcenc \
        libstagefright_m4vh263enc \
        libstagefright_matroska \
        libstagefright_timedtext \
        libvpx \
        libstagefright_mpeg2ts \
        libstagefright_httplive \
+22 −4
Original line number Diff line number Diff line
@@ -29,9 +29,10 @@
#include "include/NuCachedSource2.h"
#include "include/ThrottledSource.h"
#include "include/MPEG2TSExtractor.h"
#include "include/TimedTextPlayer.h"
#include "include/WVMExtractor.h"

#include "timedtext/TimedTextPlayer.h"

#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <media/IMediaPlayerService.h>
@@ -1282,6 +1283,7 @@ void AwesomePlayer::setAudioSource(sp<MediaSource> source) {
}

void AwesomePlayer::addTextSource(sp<MediaSource> source) {
    Mutex::Autolock autoLock(mTimedTextLock);
    CHECK(source != NULL);

    if (mTextPlayer == NULL) {
@@ -2066,11 +2068,27 @@ void AwesomePlayer::postAudioSeekComplete_l() {
}

status_t AwesomePlayer::setParameter(int key, const Parcel &request) {
    if (key == KEY_PARAMETER_TIMED_TEXT_TRACK_INDEX) {
    switch (key) {
        case KEY_PARAMETER_TIMED_TEXT_TRACK_INDEX:
        {
            Mutex::Autolock autoLock(mTimedTextLock);
            return setTimedTextTrackIndex(request.readInt32());
        }
        case KEY_PARAMETER_TIMED_TEXT_ADD_OUT_OF_BAND_SOURCE:
        {
            Mutex::Autolock autoLock(mTimedTextLock);
            if (mTextPlayer == NULL) {
                mTextPlayer = new TimedTextPlayer(this, mListener, &mQueue);
            }

            return mTextPlayer->setParameter(key, request);
        }
        default:
        {
            return ERROR_UNSUPPORTED;
        }
    }
}

status_t AwesomePlayer::getParameter(int key, Parcel *reply) {
    return OK;
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
#include "include/MPEG4Extractor.h"
#include "include/SampleTable.h"
#include "include/ESDS.h"
#include "include/TimedTextPlayer.h"
#include "timedtext/TimedTextPlayer.h"

#include <arpa/inet.h>

+1 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ private:

    int64_t mLastVideoTimeUs;
    TimedTextPlayer *mTextPlayer;
    mutable Mutex mTimedTextLock;

    sp<WVMExtractor> mWVMExtractor;

Loading