content/media/omx/AudioOffloadPlayerBase.h

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
     3 /*
     4  * Copyright (c) 2014 The Linux Foundation. All rights reserved.
     5  * Copyright (C) 2009 The Android Open Source Project
     6  *
     7  * Licensed under the Apache License, Version 2.0 (the "License");
     8  * you may not use this file except in compliance with the License.
     9  * You may obtain a copy of the License at
    10  *
    11  *      http://www.apache.org/licenses/LICENSE-2.0
    12  *
    13  * Unless required by applicable law or agreed to in writing, software
    14  * distributed under the License is distributed on an "AS IS" BASIS,
    15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    16  * See the License for the specific language governing permissions and
    17  * limitations under the License.
    18  */
    20 #ifndef AUDIO_OFFLOAD_PLAYER_BASE_H_
    21 #define AUDIO_OFFLOAD_PLAYER_BASE_H_
    23 #include "MediaDecoderOwner.h"
    24 #include "MediaOmxDecoder.h"
    26 namespace mozilla {
    28 class MediaOmxDecoder;
    30 /**
    31  * AudioOffloadPlayer interface class which has funtions used by MediaOmxDecoder
    32  * This is to reduce the dependency of AudioOffloadPlayer in MediaOmxDecoder
    33  */
    34 class AudioOffloadPlayerBase
    35 {
    36   typedef android::status_t status_t;
    37   typedef android::MediaSource MediaSource;
    39 public:
    40   virtual ~AudioOffloadPlayerBase() {};
    42   // Caller retains ownership of "aSource".
    43   virtual void SetSource(const android::sp<MediaSource> &aSource) {}
    45   // Start the source if it's not already started and open the AudioSink to
    46   // create an offloaded audio track
    47   virtual status_t Start(bool aSourceAlreadyStarted = false)
    48   {
    49     return android::NO_INIT;
    50   }
    52   virtual status_t ChangeState(MediaDecoder::PlayState aState)
    53   {
    54     return android::NO_INIT;
    55   }
    57   virtual void SetVolume(double aVolume) {}
    59   virtual double GetMediaTimeSecs() { return 0; }
    61   // To update progress bar when the element is visible
    62   virtual void SetElementVisibility(bool aIsVisible) {}
    64   // Update ready state based on current play state. Not checking data
    65   // availability since offloading is currently done only when whole compressed
    66   // data is available
    67   virtual MediaDecoderOwner::NextFrameStatus GetNextFrameStatus()
    68   {
    69     return MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
    70   }
    71 };
    73 } // namespace mozilla
    75 #endif // AUDIO_OFFLOAD_PLAYER_BASE_H_

mercurial