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

Issue 119853003: [PPAPI] Implement an IOStreamResource for data transmission between plugin and renderer. (Closed)

Created:
6 years, 12 months ago by Peng
Modified:
6 years, 11 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

[PPAPI] Implement an IOStreamResource for data transmission between plugin and renderer. It will be used by MediaStream API - MediaStreamVideo/AudioTrack and MediaStreamVideo/AudioProducer will inherit from IOStreamResource to get the data transmission functionality. BUG=330851

Patch Set 1 : Update #

Total comments: 45

Patch Set 2 : Update #

Total comments: 12

Patch Set 3 : Update #

Total comments: 67
Unified diffs Side-by-side diffs Delta from patch set Stats (+1062 lines, -1 line) Patch
M content/content_renderer.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/pepper/pepper_io_stream_host.h View 1 1 chunk +52 lines, -0 lines 1 comment Download
A content/renderer/pepper/pepper_io_stream_host.cc View 1 2 1 chunk +120 lines, -0 lines 5 comments Download
ppapi/host/ppapi_host.h View 1 2 chunks +7 lines, -0 lines 2 comments Download
M ppapi/host/ppapi_host.cc View 2 chunks +12 lines, -1 line 2 comments Download
ppapi/ppapi_proxy.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/ppapi_shared.gypi View 2 chunks +4 lines, -0 lines 0 comments Download
M ppapi/ppapi_tests.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
A ppapi/proxy/io_stream_resource.h View 1 2 1 chunk +66 lines, -0 lines 3 comments Download
A ppapi/proxy/io_stream_resource.cc View 1 2 1 chunk +89 lines, -0 lines 10 comments Download
M ppapi/proxy/ppapi_messages.h View 1 2 1 chunk +11 lines, -0 lines 1 comment Download
A ppapi/shared_impl/circular_buffer.h View 1 1 chunk +92 lines, -0 lines 16 comments Download
A ppapi/shared_impl/circular_buffer.cc View 1 1 chunk +164 lines, -0 lines 11 comments Download
ppapi/shared_impl/circular_buffer_unittest.cc View 1 chunk +223 lines, -0 lines 1 comment Download
A ppapi/shared_impl/io_stream_shared.h View 1 2 1 chunk +85 lines, -0 lines 12 comments Download
A ppapi/shared_impl/io_stream_shared.cc View 1 1 chunk +132 lines, -0 lines 3 comments Download

Messages

Total messages: 15 (0 generated)
Peng
Hi, This CL adds an IOStreamResource which will be used as base class of MediaStream{Audio,Video}{Track,Producer} ...
6 years, 11 months ago (2013-12-30 18:02:27 UTC) #1
bbudge
https://codereview.chromium.org/119853003/diff/220001/content/renderer/pepper/pepper_io_stream_host.cc File content/renderer/pepper/pepper_io_stream_host.cc (right): https://codereview.chromium.org/119853003/diff/220001/content/renderer/pepper/pepper_io_stream_host.cc#newcode41 content/renderer/pepper/pepper_io_stream_host.cc:41: bool input) is_input https://codereview.chromium.org/119853003/diff/220001/content/renderer/pepper/pepper_io_stream_host.h File content/renderer/pepper/pepper_io_stream_host.h (right): https://codereview.chromium.org/119853003/diff/220001/content/renderer/pepper/pepper_io_stream_host.h#newcode19 content/renderer/pepper/pepper_io_stream_host.h:19: ...
6 years, 11 months ago (2013-12-31 00:51:53 UTC) #2
Peng
https://codereview.chromium.org/119853003/diff/220001/content/renderer/pepper/pepper_io_stream_host.cc File content/renderer/pepper/pepper_io_stream_host.cc (right): https://codereview.chromium.org/119853003/diff/220001/content/renderer/pepper/pepper_io_stream_host.cc#newcode41 content/renderer/pepper/pepper_io_stream_host.cc:41: bool input) On 2013/12/31 00:51:53, bbudge1 wrote: > is_input ...
6 years, 11 months ago (2013-12-31 23:33:53 UTC) #3
bbudge
https://codereview.chromium.org/119853003/diff/220001/ppapi/shared_impl/io_stream_shared.h File ppapi/shared_impl/io_stream_shared.h (right): https://codereview.chromium.org/119853003/diff/220001/ppapi/shared_impl/io_stream_shared.h#newcode78 ppapi/shared_impl/io_stream_shared.h:78: scoped_ptr<CircularBuffer> circular_buffer_new_; On 2013/12/31 23:33:54, Peng wrote: > On ...
6 years, 11 months ago (2014-01-02 18:51:42 UTC) #4
Peng
On 2014/01/02 18:51:42, bbudge1 wrote: > https://codereview.chromium.org/119853003/diff/220001/ppapi/shared_impl/io_stream_shared.h > File ppapi/shared_impl/io_stream_shared.h (right): > > https://codereview.chromium.org/119853003/diff/220001/ppapi/shared_impl/io_stream_shared.h#newcode78 > ...
6 years, 11 months ago (2014-01-02 20:36:10 UTC) #5
bbudge
On 2014/01/02 20:36:10, Peng wrote: > On 2014/01/02 18:51:42, bbudge1 wrote: > > > https://codereview.chromium.org/119853003/diff/220001/ppapi/shared_impl/io_stream_shared.h ...
6 years, 11 months ago (2014-01-02 21:25:56 UTC) #6
bbudge
https://codereview.chromium.org/119853003/diff/480001/content/renderer/pepper/pepper_io_stream_host.cc File content/renderer/pepper/pepper_io_stream_host.cc (right): https://codereview.chromium.org/119853003/diff/480001/content/renderer/pepper/pepper_io_stream_host.cc#newcode50 content/renderer/pepper/pepper_io_stream_host.cc:50: CHECK(offset); DCHECK? https://codereview.chromium.org/119853003/diff/480001/content/renderer/pepper/pepper_io_stream_host.cc#newcode74 content/renderer/pepper/pepper_io_stream_host.cc:74: shm = render_thread->HostAllocateSharedMemoryBuffer(size).Pass(); Why not ...
6 years, 11 months ago (2014-01-02 22:16:22 UTC) #7
Peng
https://codereview.chromium.org/119853003/diff/480001/content/renderer/pepper/pepper_io_stream_host.cc File content/renderer/pepper/pepper_io_stream_host.cc (right): https://codereview.chromium.org/119853003/diff/480001/content/renderer/pepper/pepper_io_stream_host.cc#newcode50 content/renderer/pepper/pepper_io_stream_host.cc:50: CHECK(offset); On 2014/01/02 22:16:22, bbudge1 wrote: > DCHECK? Done. ...
6 years, 11 months ago (2014-01-03 16:15:10 UTC) #8
dmichael (off chromium)
Sorry for taking a while to get to this review; I was gone for most ...
6 years, 11 months ago (2014-01-03 18:05:29 UTC) #9
dmichael (off chromium)
The way Lock is implemented, doesn't this imply that you can only use Lock and ...
6 years, 11 months ago (2014-01-03 18:33:17 UTC) #10
Peng
https://codereview.chromium.org/119853003/diff/660002/ppapi/proxy/io_stream_resource.cc File ppapi/proxy/io_stream_resource.cc (right): https://codereview.chromium.org/119853003/diff/660002/ppapi/proxy/io_stream_resource.cc#newcode69 ppapi/proxy/io_stream_resource.cc:69: SetBuffer(scoped_ptr<base::SharedMemory>( On 2014/01/03 18:05:29, dmichael wrote: > Note I ...
6 years, 11 months ago (2014-01-03 21:01:49 UTC) #11
Peng
On 2014/01/03 18:33:17, dmichael wrote: > The way Lock is implemented, doesn't this imply that ...
6 years, 11 months ago (2014-01-03 21:30:05 UTC) #12
yzshen1
https://codereview.chromium.org/119853003/diff/660002/content/renderer/pepper/pepper_io_stream_host.cc File content/renderer/pepper/pepper_io_stream_host.cc (right): https://codereview.chromium.org/119853003/diff/660002/content/renderer/pepper/pepper_io_stream_host.cc#newcode14 content/renderer/pepper/pepper_io_stream_host.cc:14: nit: extra empty line https://codereview.chromium.org/119853003/diff/660002/content/renderer/pepper/pepper_io_stream_host.cc#newcode25 content/renderer/pepper/pepper_io_stream_host.cc:25: base::PlatformFile ToPlatformFile(const base::SharedMemoryHandle& ...
6 years, 11 months ago (2014-01-03 21:51:40 UTC) #13
dmichael (off chromium)
On 2014/01/03 21:30:05, Peng wrote: > On 2014/01/03 18:33:17, dmichael wrote: > > The way ...
6 years, 11 months ago (2014-01-03 22:37:05 UTC) #14
yzshen1
6 years, 11 months ago (2014-01-03 23:16:03 UTC) #15
On 2014/01/03 22:37:05, dmichael wrote:
> On 2014/01/03 21:30:05, Peng wrote:
> > On 2014/01/03 18:33:17, dmichael wrote:
> > > The way Lock is implemented, doesn't this imply that you can only use Lock
> and
> > > use 1 frame at a time? That seems bad.
> > 
> > Yeah. plugin can only access one frame at a time with the ring buffer. I
> > realized the issue, after the circluar buffer is implemented. :(
> > It is not good for multi-frame processing applications. They have to copy
> frames
> > to local buffers. Do you think is it OK? Otherwise, we have to use different
> > data structure. Thought?
> We definitely need at least 2 frames to be active, or there's really no point
in
> having a ring buffer, right? A place for the producer to write, and a place
for
> the consumer to read.
(Maybe I haven't understood.) Because producer and consumer will use different
CircularBuffer instances (which point to the same underlying shared memory
buffer), so they can lock separately. Right?

That being said, it seems helpful if we allow the reader/the writer to access
multiple frames at the same time.
Maybe we could consider it later, it won't require too much change to the Pepper
API. For example, we just remove/loosen the restrictions that
PPB_MediaStreamVideoTrack.RecycleFrame() must be called before the next
PPB_MediaStreamVideoTrack.GetFrame().


> > It does not allow both reading and writing on the same side. For input side,
> > Read() will fail. Same Write() will fail for output side. Why keep them in
one
> > class is for avoiding many duplicated code.
I like the idea of avoiding duplicate code. But I don't think we should
sacrifice readability to achieve that.
I think we can use shared impl to reduce duplicate code but expose different
interfaces for read/write.
What do you think?

Powered by Google App Engine
This is Rietveld 408576698