mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 02:35:41 +00:00
01583602a9
The bulk of this commit was generated with a script, executed at the top level of a typical source code checkout. The only non-machine-generated part was modifying MFBT's moz.build to reflect the new naming. CLOSED TREE makes big refactorings like this a piece of cake. # The main substitution. find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \ xargs perl -p -i -e ' s/nsRefPtr\.h/RefPtr\.h/g; # handle includes s/nsRefPtr ?</RefPtr</g; # handle declarations and variables ' # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h. perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h # Handle nsRefPtr.h itself, a couple places that define constructors # from nsRefPtr, and code generators specially. We do this here, rather # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename # things like nsRefPtrHashtable. perl -p -i -e 's/nsRefPtr/RefPtr/g' \ mfbt/nsRefPtr.h \ xpcom/glue/nsCOMPtr.h \ xpcom/base/OwningNonNull.h \ ipc/ipdl/ipdl/lower.py \ ipc/ipdl/ipdl/builtin.py \ dom/bindings/Codegen.py \ python/lldbutils/lldbutils/utils.py # In our indiscriminate substitution above, we renamed # nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up. find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \ xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g' if [ -d .git ]; then git mv mfbt/nsRefPtr.h mfbt/RefPtr.h else hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h fi --HG-- rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
76 lines
2.3 KiB
C++
76 lines
2.3 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
/*
|
|
* Copyright (c) 2014 The Linux Foundation. All rights reserved.
|
|
* Copyright (C) 2009 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef AUDIO_OFFLOAD_PLAYER_BASE_H_
|
|
#define AUDIO_OFFLOAD_PLAYER_BASE_H_
|
|
|
|
#include "MediaDecoder.h"
|
|
#include "MediaDecoderOwner.h"
|
|
|
|
namespace mozilla {
|
|
|
|
/**
|
|
* AudioOffloadPlayer interface class which has funtions used by MediaOmxDecoder
|
|
* This is to reduce the dependency of AudioOffloadPlayer in MediaOmxDecoder
|
|
*/
|
|
class AudioOffloadPlayerBase
|
|
{
|
|
typedef android::status_t status_t;
|
|
typedef android::MediaSource MediaSource;
|
|
|
|
public:
|
|
virtual ~AudioOffloadPlayerBase() {};
|
|
|
|
// Caller retains ownership of "aSource".
|
|
virtual void SetSource(const android::sp<MediaSource> &aSource) {}
|
|
|
|
// Start the source if it's not already started and open the AudioSink to
|
|
// create an offloaded audio track
|
|
virtual status_t Start(bool aSourceAlreadyStarted = false)
|
|
{
|
|
return android::NO_INIT;
|
|
}
|
|
|
|
virtual status_t ChangeState(MediaDecoder::PlayState aState)
|
|
{
|
|
return android::NO_INIT;
|
|
}
|
|
|
|
virtual void SetVolume(double aVolume) {}
|
|
|
|
virtual int64_t GetMediaTimeUs() { return 0; }
|
|
|
|
// To update progress bar when the element is visible
|
|
virtual void SetElementVisibility(bool aIsVisible) {}
|
|
|
|
// Update ready state based on current play state. Not checking data
|
|
// availability since offloading is currently done only when whole compressed
|
|
// data is available
|
|
virtual MediaDecoderOwner::NextFrameStatus GetNextFrameStatus()
|
|
{
|
|
return MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
|
|
}
|
|
|
|
virtual RefPtr<MediaDecoder::SeekPromise> Seek(SeekTarget aTarget) = 0;
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif // AUDIO_OFFLOAD_PLAYER_BASE_H_
|