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

Commit 965d08ba authored by Gloria Wang's avatar Gloria Wang
Browse files

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

Change-Id: I9e024a63eb9bf6f839deee3c7766a66e63126c96
parent 162f7d15
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>
@@ -1277,6 +1278,7 @@ void AwesomePlayer::setAudioSource(sp<MediaSource> source) {
}

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

    if (mTextPlayer == NULL) {
@@ -2061,11 +2063,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