Loading include/media/MediaPlayerInterface.h +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public: virtual status_t getPosition(uint32_t *position) const = 0; virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0; virtual int getSessionId() const = 0; virtual audio_stream_type_t getAudioStreamType() const = 0; // If no callback is specified, use the "write" API below to submit // audio data. Loading include/media/stagefright/Utils.h +2 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ status_t mapMimeToAudioFormat(audio_format_t& format, const char* mime); status_t sendMetaDataToHal(sp<MediaPlayerBase::AudioSink>& sink, const sp<MetaData>& meta); // Check whether the stream defined by meta can be offloaded to hardware bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming); bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming, audio_stream_type_t streamType); } // namespace android Loading libvideoeditor/lvpp/VideoEditorPlayer.h +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class VideoEditorPlayer : public MediaPlayerInterface { virtual void pause(); virtual void close(); void setAudioStreamType(audio_stream_type_t streamType) { mStreamType = streamType; } virtual audio_stream_type_t getAudioStreamType() const { return mStreamType; } void setVolume(float left, float right); virtual status_t dump(int fd,const Vector<String16>& args) const; Loading media/libmediaplayerservice/MediaPlayerService.h +7 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,10 @@ class MediaPlayerService : public BnMediaPlayerService virtual void flush(); virtual void pause(); virtual void close(); void setAudioStreamType(audio_stream_type_t streamType) { mStreamType = streamType; } void setAudioStreamType(audio_stream_type_t streamType) { mStreamType = streamType; } virtual audio_stream_type_t getAudioStreamType() const { return mStreamType; } void setVolume(float left, float right); virtual status_t setPlaybackRatePermille(int32_t ratePermille); status_t setAuxEffectSendLevel(float level); Loading Loading @@ -207,6 +210,9 @@ class MediaPlayerService : public BnMediaPlayerService virtual void pause() {} virtual void close() {} void setAudioStreamType(audio_stream_type_t streamType) {} // stream type is not used for AudioCache virtual audio_stream_type_t getAudioStreamType() const { return AUDIO_STREAM_DEFAULT; } void setVolume(float left, float right) {} virtual status_t setPlaybackRatePermille(int32_t ratePermille) { return INVALID_OPERATION; } uint32_t sampleRate() const { return mSampleRate; } Loading media/libstagefright/AwesomePlayer.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -1499,7 +1499,13 @@ status_t AwesomePlayer::initAudioDecoder() { // This doesn't guarantee that the hardware has a free stream // but it avoids us attempting to open (and re-open) an offload // stream to hardware that doesn't have the necessary codec mOffloadAudio = canOffloadStream(meta, (mVideoSource != NULL), isStreamingHTTP()); audio_stream_type_t streamType = AUDIO_STREAM_MUSIC; if (mAudioSink != NULL) { streamType = mAudioSink->getAudioStreamType(); } mOffloadAudio = canOffloadStream(meta, (mVideoSource != NULL), isStreamingHTTP(), streamType); if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_RAW)) { ALOGV("createAudioPlayer: bypass OMX (raw)"); Loading Loading
include/media/MediaPlayerInterface.h +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public: virtual status_t getPosition(uint32_t *position) const = 0; virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0; virtual int getSessionId() const = 0; virtual audio_stream_type_t getAudioStreamType() const = 0; // If no callback is specified, use the "write" API below to submit // audio data. Loading
include/media/stagefright/Utils.h +2 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ status_t mapMimeToAudioFormat(audio_format_t& format, const char* mime); status_t sendMetaDataToHal(sp<MediaPlayerBase::AudioSink>& sink, const sp<MetaData>& meta); // Check whether the stream defined by meta can be offloaded to hardware bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming); bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming, audio_stream_type_t streamType); } // namespace android Loading
libvideoeditor/lvpp/VideoEditorPlayer.h +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class VideoEditorPlayer : public MediaPlayerInterface { virtual void pause(); virtual void close(); void setAudioStreamType(audio_stream_type_t streamType) { mStreamType = streamType; } virtual audio_stream_type_t getAudioStreamType() const { return mStreamType; } void setVolume(float left, float right); virtual status_t dump(int fd,const Vector<String16>& args) const; Loading
media/libmediaplayerservice/MediaPlayerService.h +7 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,10 @@ class MediaPlayerService : public BnMediaPlayerService virtual void flush(); virtual void pause(); virtual void close(); void setAudioStreamType(audio_stream_type_t streamType) { mStreamType = streamType; } void setAudioStreamType(audio_stream_type_t streamType) { mStreamType = streamType; } virtual audio_stream_type_t getAudioStreamType() const { return mStreamType; } void setVolume(float left, float right); virtual status_t setPlaybackRatePermille(int32_t ratePermille); status_t setAuxEffectSendLevel(float level); Loading Loading @@ -207,6 +210,9 @@ class MediaPlayerService : public BnMediaPlayerService virtual void pause() {} virtual void close() {} void setAudioStreamType(audio_stream_type_t streamType) {} // stream type is not used for AudioCache virtual audio_stream_type_t getAudioStreamType() const { return AUDIO_STREAM_DEFAULT; } void setVolume(float left, float right) {} virtual status_t setPlaybackRatePermille(int32_t ratePermille) { return INVALID_OPERATION; } uint32_t sampleRate() const { return mSampleRate; } Loading
media/libstagefright/AwesomePlayer.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -1499,7 +1499,13 @@ status_t AwesomePlayer::initAudioDecoder() { // This doesn't guarantee that the hardware has a free stream // but it avoids us attempting to open (and re-open) an offload // stream to hardware that doesn't have the necessary codec mOffloadAudio = canOffloadStream(meta, (mVideoSource != NULL), isStreamingHTTP()); audio_stream_type_t streamType = AUDIO_STREAM_MUSIC; if (mAudioSink != NULL) { streamType = mAudioSink->getAudioStreamType(); } mOffloadAudio = canOffloadStream(meta, (mVideoSource != NULL), isStreamingHTTP(), streamType); if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_RAW)) { ALOGV("createAudioPlayer: bypass OMX (raw)"); Loading