Index: media/gpu/android_video_decode_accelerator.h |
diff --git a/media/gpu/android_video_decode_accelerator.h b/media/gpu/android_video_decode_accelerator.h |
index 6885bdaebbf1e96010820248f11e839e9993eefa..e5cc82049cbc2294d94636dbf7d93e93668234f1 100644 |
--- a/media/gpu/android_video_decode_accelerator.h |
+++ b/media/gpu/android_video_decode_accelerator.h |
@@ -43,10 +43,10 @@ class SharedMemoryRegion; |
// It delegates attaching pictures to PictureBuffers to a BackingStrategy, but |
// otherwise handles the work of transferring data to / from MediaCodec. |
class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
- : public media::VideoDecodeAccelerator, |
+ : public VideoDecodeAccelerator, |
public AVDAStateProvider { |
public: |
- using OutputBufferMap = std::map<int32_t, media::PictureBuffer>; |
+ using OutputBufferMap = std::map<int32_t, PictureBuffer>; |
// A BackingStrategy is responsible for making a PictureBuffer's texture |
// contain the image that a MediaCodec decoder buffer tells it to. |
@@ -79,16 +79,14 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// the decoded output buffer at codec_buffer_index. |
virtual void UseCodecBufferForPictureBuffer( |
int32_t codec_buffer_index, |
- const media::PictureBuffer& picture_buffer) = 0; |
+ const PictureBuffer& picture_buffer) = 0; |
// Notify strategy that a picture buffer has been assigned. |
- virtual void AssignOnePictureBuffer( |
- const media::PictureBuffer& picture_buffer, |
- bool have_context) {} |
+ virtual void AssignOnePictureBuffer(const PictureBuffer& picture_buffer, |
+ bool have_context) {} |
// Notify strategy that a picture buffer has been reused. |
- virtual void ReuseOnePictureBuffer( |
- const media::PictureBuffer& picture_buffer) {} |
+ virtual void ReuseOnePictureBuffer(const PictureBuffer& picture_buffer) {} |
// Release MediaCodec buffers. |
virtual void ReleaseCodecBuffers( |
@@ -100,7 +98,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// Notify strategy that we have a new android MediaCodec instance. This |
// happens when we're starting up or re-configuring mid-stream. Any |
// previously provided codec should no longer be referenced. |
- virtual void CodecChanged(media::VideoCodecBridge* codec) = 0; |
+ virtual void CodecChanged(VideoCodecBridge* codec) = 0; |
// Notify the strategy that a frame is available. This callback can happen |
// on any thread at any time. |
@@ -114,7 +112,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// |new_size| and also update any size-dependent state (e.g. size of |
// associated texture). Callers should set the correct GL context prior to |
// calling. |
- virtual void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer, |
+ virtual void UpdatePictureBufferSize(PictureBuffer* picture_buffer, |
const gfx::Size& new_size) = 0; |
}; |
@@ -124,11 +122,10 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
~AndroidVideoDecodeAccelerator() override; |
- // media::VideoDecodeAccelerator implementation: |
+ // VideoDecodeAccelerator implementation: |
bool Initialize(const Config& config, Client* client) override; |
- void Decode(const media::BitstreamBuffer& bitstream_buffer) override; |
- void AssignPictureBuffers( |
- const std::vector<media::PictureBuffer>& buffers) override; |
+ void Decode(const BitstreamBuffer& bitstream_buffer) override; |
+ void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; |
void ReusePictureBuffer(int32_t picture_buffer_id) override; |
void Flush() override; |
void Reset() override; |
@@ -143,13 +140,13 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
const base::ThreadChecker& ThreadChecker() const override; |
base::WeakPtr<gpu::gles2::GLES2Decoder> GetGlDecoder() const override; |
gpu::gles2::TextureRef* GetTextureForPicture( |
- const media::PictureBuffer& picture_buffer) override; |
+ const PictureBuffer& picture_buffer) override; |
scoped_refptr<gl::SurfaceTexture> CreateAttachedSurfaceTexture( |
GLuint* service_id) override; |
void PostError(const ::tracked_objects::Location& from_here, |
- media::VideoDecodeAccelerator::Error error) override; |
+ VideoDecodeAccelerator::Error error) override; |
- static media::VideoDecodeAccelerator::Capabilities GetCapabilities( |
+ static VideoDecodeAccelerator::Capabilities GetCapabilities( |
const gpu::GpuPreferences& gpu_preferences); |
// Notifies about SurfaceTexture::OnFrameAvailable. This can happen on any |
@@ -189,7 +186,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
CodecConfig(); |
// Codec type. Used when we configure media codec. |
- media::VideoCodec codec_ = media::kUnknownVideoCodec; |
+ VideoCodec codec_ = kUnknownVideoCodec; |
// Whether encryption scheme requires to use protected surface. |
bool needs_protected_surface_ = false; |
@@ -200,7 +197,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// The MediaCrypto object is used in the MediaCodec.configure() in case of |
// an encrypted stream. |
- media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto_; |
+ MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto_; |
// Initial coded size. The actual size might change at any time, so this |
// is only a hint. |
@@ -245,12 +242,12 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// Instantiate a media codec using |codec_config|. |
// This may be called on any thread. |
- static std::unique_ptr<media::VideoCodecBridge> |
- ConfigureMediaCodecOnAnyThread(scoped_refptr<CodecConfig> codec_config); |
+ static std::unique_ptr<VideoCodecBridge> ConfigureMediaCodecOnAnyThread( |
+ scoped_refptr<CodecConfig> codec_config); |
// Called on the main thread to update |media_codec_| and complete codec |
// configuration. |media_codec| will be null if configuration failed. |
- void OnCodecConfigured(std::unique_ptr<media::VideoCodecBridge> media_codec); |
+ void OnCodecConfigured(std::unique_ptr<VideoCodecBridge> media_codec); |
// Sends the decoded frame specified by |codec_buffer_index| to the client. |
void SendDecodedFrameToClient(int32_t codec_buffer_index, |
@@ -276,15 +273,14 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// Decode the content in the |bitstream_buffer|. Note that a |
// |bitstream_buffer| of id as -1 indicates a flush command. |
- void DecodeBuffer(const media::BitstreamBuffer& bitstream_buffer); |
+ void DecodeBuffer(const BitstreamBuffer& bitstream_buffer); |
// Called during Initialize() for encrypted streams to set up the CDM. |
void InitializeCdm(); |
// Called after the CDM obtains a MediaCrypto object. |
- void OnMediaCryptoReady( |
- media::MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto, |
- bool needs_protected_surface); |
+ void OnMediaCryptoReady(MediaDrmBridgeCdmContext::JavaObjectPtr media_crypto, |
+ bool needs_protected_surface); |
// Called when a new key is added to the CDM. |
void OnKeyAdded(); |
@@ -293,7 +289,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
void NotifyInitializationComplete(bool success); |
// Notifies the client about the availability of a picture. |
- void NotifyPictureReady(const media::Picture& picture); |
+ void NotifyPictureReady(const Picture& picture); |
// Notifies the client that the input buffer identifed by input_buffer_id has |
// been processed. |
@@ -311,7 +307,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// from breaking. NotifyError will do so immediately, PostError may wait. |
// |token| has to match |error_sequence_token_|, or else it's assumed to be |
// from a post that's prior to a previous reset, and ignored. |
- void NotifyError(media::VideoDecodeAccelerator::Error error, int token); |
+ void NotifyError(VideoDecodeAccelerator::Error error, int token); |
// Start or stop our work-polling timer based on whether we did any work, and |
// how long it has been since we've done work. Calling this with true will |
@@ -373,7 +369,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
std::queue<int32_t> free_picture_ids_; |
// The low-level decoder which Android SDK provides. |
- std::unique_ptr<media::VideoCodecBridge> media_codec_; |
+ std::unique_ptr<VideoCodecBridge> media_codec_; |
// Set to true after requesting picture buffers to the client. |
bool picturebuffers_requested_; |
@@ -385,11 +381,11 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
// if any. The goal is to prevent leaving a BitstreamBuffer's shared memory |
// handle open. |
struct BitstreamRecord { |
- BitstreamRecord(const media::BitstreamBuffer&); |
+ BitstreamRecord(const BitstreamBuffer&); |
BitstreamRecord(BitstreamRecord&& other); |
~BitstreamRecord(); |
- media::BitstreamBuffer buffer; |
+ BitstreamBuffer buffer; |
// |memory| is not mapped, and may be null if buffer has no data. |
std::unique_ptr<SharedMemoryRegion> memory; |
@@ -424,9 +420,9 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator |
DrainType drain_type_; |
// Holds a ref-count to the CDM to avoid using the CDM after it's destroyed. |
- scoped_refptr<media::MediaKeys> cdm_for_reference_holding_only_; |
+ scoped_refptr<MediaKeys> cdm_for_reference_holding_only_; |
- media::MediaDrmBridgeCdmContext* media_drm_bridge_cdm_context_; |
+ MediaDrmBridgeCdmContext* media_drm_bridge_cdm_context_; |
// MediaDrmBridge requires registration/unregistration of the player, this |
// registration id is used for this. |