michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* michael@0: * Copyright (c) 2014 The Linux Foundation. All rights reserved. michael@0: * Copyright (C) 2009 The Android Open Source Project michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: #ifndef AUDIO_OFFLOAD_PLAYER_BASE_H_ michael@0: #define AUDIO_OFFLOAD_PLAYER_BASE_H_ michael@0: michael@0: #include "MediaDecoderOwner.h" michael@0: #include "MediaOmxDecoder.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class MediaOmxDecoder; michael@0: michael@0: /** michael@0: * AudioOffloadPlayer interface class which has funtions used by MediaOmxDecoder michael@0: * This is to reduce the dependency of AudioOffloadPlayer in MediaOmxDecoder michael@0: */ michael@0: class AudioOffloadPlayerBase michael@0: { michael@0: typedef android::status_t status_t; michael@0: typedef android::MediaSource MediaSource; michael@0: michael@0: public: michael@0: virtual ~AudioOffloadPlayerBase() {}; michael@0: michael@0: // Caller retains ownership of "aSource". michael@0: virtual void SetSource(const android::sp &aSource) {} michael@0: michael@0: // Start the source if it's not already started and open the AudioSink to michael@0: // create an offloaded audio track michael@0: virtual status_t Start(bool aSourceAlreadyStarted = false) michael@0: { michael@0: return android::NO_INIT; michael@0: } michael@0: michael@0: virtual status_t ChangeState(MediaDecoder::PlayState aState) michael@0: { michael@0: return android::NO_INIT; michael@0: } michael@0: michael@0: virtual void SetVolume(double aVolume) {} michael@0: michael@0: virtual double GetMediaTimeSecs() { return 0; } michael@0: michael@0: // To update progress bar when the element is visible michael@0: virtual void SetElementVisibility(bool aIsVisible) {} michael@0: michael@0: // Update ready state based on current play state. Not checking data michael@0: // availability since offloading is currently done only when whole compressed michael@0: // data is available michael@0: virtual MediaDecoderOwner::NextFrameStatus GetNextFrameStatus() michael@0: { michael@0: return MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE; michael@0: } michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // AUDIO_OFFLOAD_PLAYER_BASE_H_