Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: content/common/gpu/media/mac_video_decode_accelerator.h

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure rebase Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_GPU_MEDIA_MAC_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_MAC_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_MAC_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_MAC_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <CoreVideo/CoreVideo.h> 8 #include <CoreVideo/CoreVideo.h>
9 #include <map> 9 #include <map>
10 #include <list> 10 #include <list>
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 class GpuCommandBufferStub; 28 class GpuCommandBufferStub;
29 29
30 class CONTENT_EXPORT MacVideoDecodeAccelerator 30 class CONTENT_EXPORT MacVideoDecodeAccelerator
31 : public media::VideoDecodeAccelerator, 31 : public media::VideoDecodeAccelerator,
32 public base::NonThreadSafe { 32 public base::NonThreadSafe {
33 public: 33 public:
34 // Does not take ownership of |client| which must outlive |*this|. 34 // Does not take ownership of |client| which must outlive |*this|.
35 MacVideoDecodeAccelerator(media::VideoDecodeAccelerator::Client* client); 35 MacVideoDecodeAccelerator(media::VideoDecodeAccelerator::Client* client);
36 virtual ~MacVideoDecodeAccelerator();
36 37
37 // Set the OpenGL context to use. 38 // Set the OpenGL context to use.
38 void SetCGLContext(CGLContextObj cgl_context); 39 void SetCGLContext(CGLContextObj cgl_context);
39 40
40 // media::VideoDecodeAccelerator implementation. 41 // media::VideoDecodeAccelerator implementation.
41 virtual bool Initialize(media::VideoCodecProfile profile) OVERRIDE; 42 virtual bool Initialize(media::VideoCodecProfile profile) OVERRIDE;
42 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; 43 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE;
43 virtual void AssignPictureBuffers( 44 virtual void AssignPictureBuffers(
44 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; 45 const std::vector<media::PictureBuffer>& buffers) OVERRIDE;
45 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; 46 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE;
46 virtual void Flush() OVERRIDE; 47 virtual void Flush() OVERRIDE;
47 virtual void Reset() OVERRIDE; 48 virtual void Reset() OVERRIDE;
48 virtual void Destroy() OVERRIDE; 49 virtual void Destroy(bool pass_ownership) OVERRIDE;
49 50
50 private: 51 private:
51 virtual ~MacVideoDecodeAccelerator();
52 52
53 // Callback for a completed frame. 53 // Callback for a completed frame.
54 void OnFrameReady(int32 bitstream_buffer_id, 54 void OnFrameReady(int32 bitstream_buffer_id,
55 scoped_refptr<base::RefCountedBytes> bytes, 55 scoped_refptr<base::RefCountedBytes> bytes,
56 CVImageBufferRef image, 56 CVImageBufferRef image,
57 int status); 57 int status);
58 58
59 // Sends available decoded frames to the client. 59 // Sends available decoded frames to the client.
60 void SendImages(); 60 void SendImages();
61 61
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Utility to build the AVC configuration record. 124 // Utility to build the AVC configuration record.
125 content::AVCConfigRecordBuilder config_record_builder_; 125 content::AVCConfigRecordBuilder config_record_builder_;
126 126
127 // Maps a bitstream ID to the number of NALUs that are being decoded for 127 // Maps a bitstream ID to the number of NALUs that are being decoded for
128 // that bitstream. This is used to ensure that NotifyEndOfBitstreamBuffer() 128 // that bitstream. This is used to ensure that NotifyEndOfBitstreamBuffer()
129 // is called after all NALUs contained in a bitstream have been decoded. 129 // is called after all NALUs contained in a bitstream have been decoded.
130 std::map<int32, int> bitstream_nalu_count_; 130 std::map<int32, int> bitstream_nalu_count_;
131 }; 131 };
132 132
133 #endif // CONTENT_COMMON_GPU_MEDIA_VIDEO_DECODE_ACCELERATOR_MAC_H_ 133 #endif // CONTENT_COMMON_GPU_MEDIA_VIDEO_DECODE_ACCELERATOR_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698