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

Side by Side Diff: media/mojo/common/mojo_shared_buffer_video_frame.h

Issue 1802183002: Convert CreateCdmBuffer() to use size_t for |capacity| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove cast Created 4 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 MEDIA_MOJO_COMMON_MOJO_SHARED_BUFFER_VIDEO_FRAME_H_ 5 #ifndef MEDIA_MOJO_COMMON_MOJO_SHARED_BUFFER_VIDEO_FRAME_H_
6 #define MEDIA_MOJO_COMMON_MOJO_SHARED_BUFFER_VIDEO_FRAME_H_ 6 #define MEDIA_MOJO_COMMON_MOJO_SHARED_BUFFER_VIDEO_FRAME_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 // A derived class of media::VideoFrame holding a mojo::SharedBufferHandle 32 // A derived class of media::VideoFrame holding a mojo::SharedBufferHandle
33 // which is mapped on constructor and remains so for the lifetime of the 33 // which is mapped on constructor and remains so for the lifetime of the
34 // object. These frames are ref-counted. 34 // object. These frames are ref-counted.
35 class MojoSharedBufferVideoFrame : public VideoFrame { 35 class MojoSharedBufferVideoFrame : public VideoFrame {
36 public: 36 public:
37 // Callback called when this object is destructed. Ownership of the shared 37 // Callback called when this object is destructed. Ownership of the shared
38 // memory is transferred to the callee. 38 // memory is transferred to the callee.
39 using MojoSharedBufferDoneCB = 39 using MojoSharedBufferDoneCB =
40 base::Callback<void(mojo::ScopedSharedBufferHandle buffer, 40 base::Callback<void(mojo::ScopedSharedBufferHandle buffer,
41 uint32_t capacity)>; 41 size_t capacity)>;
42 42
43 // Creates a new I420 frame in shared memory with provided parameters 43 // Creates a new I420 frame in shared memory with provided parameters
44 // (coded_size() == natural_size() == visible_rect()), or returns nullptr. 44 // (coded_size() == natural_size() == visible_rect()), or returns nullptr.
45 // Buffers for the frame are allocated but not initialized. The caller must 45 // Buffers for the frame are allocated but not initialized. The caller must
46 // not make assumptions about the actual underlying sizes, but check the 46 // not make assumptions about the actual underlying sizes, but check the
47 // returned VideoFrame instead. 47 // returned VideoFrame instead.
48 static scoped_refptr<MojoSharedBufferVideoFrame> CreateDefaultI420( 48 static scoped_refptr<MojoSharedBufferVideoFrame> CreateDefaultI420(
49 const gfx::Size& dimensions, 49 const gfx::Size& dimensions,
50 base::TimeDelta timestamp); 50 base::TimeDelta timestamp);
51 51
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 uint8_t* shared_buffer_data_; 114 uint8_t* shared_buffer_data_;
115 size_t offsets_[kMaxPlanes]; 115 size_t offsets_[kMaxPlanes];
116 MojoSharedBufferDoneCB mojo_shared_buffer_done_cb_; 116 MojoSharedBufferDoneCB mojo_shared_buffer_done_cb_;
117 117
118 DISALLOW_COPY_AND_ASSIGN(MojoSharedBufferVideoFrame); 118 DISALLOW_COPY_AND_ASSIGN(MojoSharedBufferVideoFrame);
119 }; 119 };
120 120
121 } // namespace media 121 } // namespace media
122 122
123 #endif // MEDIA_MOJO_COMMON_MOJO_SHARED_BUFFER_VIDEO_FRAME_H_ 123 #endif // MEDIA_MOJO_COMMON_MOJO_SHARED_BUFFER_VIDEO_FRAME_H_
OLDNEW
« no previous file with comments | « media/cdm/simple_cdm_buffer.cc ('k') | media/mojo/common/mojo_shared_buffer_video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698