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

Issue 3233003: Add a VideoDecodeContext that provides resources for a VideoDecodeEngine (Closed)

Created:
10 years, 3 months ago by Alpha Left Google
Modified:
9 years, 6 months ago
CC:
chromium-reviews, scherkus (not reviewing), fbarchard, awong, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Add a VideoDecodeContext that provides resources for a VideoDecodeEngine Also define a Gles2VideoDecodeContext to be used in the chrome renderer. BUG=53714 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=58772

Patch Set 1 #

Patch Set 2 : a few more lines #

Patch Set 3 : decode context for renderer #

Patch Set 4 : fixed the interface #

Total comments: 19

Patch Set 5 : fixed commentsd #

Total comments: 3

Patch Set 6 : updated API #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -0 lines) Patch
M chrome/chrome_renderer.gypi View 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/renderer/media/gles2_video_decode_context.h View 3 4 5 1 chunk +117 lines, -0 lines 0 comments Download
A chrome/renderer/media/gles2_video_decode_context.cc View 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
A media/video/video_decode_context.h View 1 2 3 4 5 1 chunk +51 lines, -0 lines 1 comment Download

Messages

Total messages: 12 (0 generated)
Alpha Left Google
10 years, 3 months ago (2010-08-28 18:00:08 UTC) #1
scherkus (not reviewing)
http://codereview.chromium.org/3233003/diff/8001/9003 File chrome/renderer/media/gles2_video_decode_context.h (right): http://codereview.chromium.org/3233003/diff/8001/9003#newcode33 chrome/renderer/media/gles2_video_decode_context.h:33: // software video decoding and use them as if ...
10 years, 3 months ago (2010-08-30 19:29:52 UTC) #2
Alpha Left Google
10 years, 3 months ago (2010-08-30 23:52:51 UTC) #3
Alpha Left Google
http://codereview.chromium.org/3233003/diff/8001/9003 File chrome/renderer/media/gles2_video_decode_context.h (right): http://codereview.chromium.org/3233003/diff/8001/9003#newcode33 chrome/renderer/media/gles2_video_decode_context.h:33: // software video decoding and use them as if ...
10 years, 3 months ago (2010-08-31 00:07:23 UTC) #4
scherkus (not reviewing)
http://codereview.chromium.org/3233003/diff/15001/16005 File media/video/video_decode_context.h (right): http://codereview.chromium.org/3233003/diff/15001/16005#newcode33 media/video/video_decode_context.h:33: virtual void ReleaseDevice(void* device); another question: when/why would we ...
10 years, 3 months ago (2010-08-31 02:58:56 UTC) #5
vrk (LEFT CHROMIUM)
http://codereview.chromium.org/3233003/diff/15001/16005 File media/video/video_decode_context.h (right): http://codereview.chromium.org/3233003/diff/15001/16005#newcode38 media/video/video_decode_context.h:38: AllocationCompleteCallback* callback) = 0; On 2010/08/31 02:58:56, scherkus wrote: ...
10 years, 3 months ago (2010-08-31 19:42:43 UTC) #6
vrk (LEFT CHROMIUM)
> But Alpha said there were some performance issues with thread-switching and > stuff... I ...
10 years, 3 months ago (2010-08-31 23:22:21 UTC) #7
scherkus (not reviewing)
cool! let's discuss this tomorrow complete with snacks, beverages and a whiteboard :)
10 years, 3 months ago (2010-09-01 03:22:17 UTC) #8
Alpha Left Google
The API is updated. Please have an other look.
10 years, 3 months ago (2010-09-03 01:33:20 UTC) #9
scherkus (not reviewing)
+ajwong for allocate/release comments (I think you had some during that little whiteboard session) http://codereview.chromium.org/3233003/diff/26001/27005 ...
10 years, 3 months ago (2010-09-03 17:50:13 UTC) #10
scherkus (not reviewing)
so while the API feels a bit strange -- rest is LGTM you can go ...
10 years, 3 months ago (2010-09-03 17:52:17 UTC) #11
Alpha Left Google
10 years, 3 months ago (2010-09-03 18:18:28 UTC) #12
On 2010/09/03 17:50:13, scherkus wrote:
> +ajwong for allocate/release comments (I think you had some during that little
> whiteboard session)
> 
> http://codereview.chromium.org/3233003/diff/26001/27005
> File media/video/video_decode_context.h (right):
> 
> http://codereview.chromium.org/3233003/diff/26001/27005#newcode39
> media/video/video_decode_context.h:39: virtual void ReleaseVideoFrames(int n,
> VideoFrame* frames) = 0;
> this is still a bit clumsy
> 
> so AllocateVideoFrames returns an array of VideoFrame* (basically a
> VideoFrame**).  Do I copy the array of pointers or do I now own the array of
> pointers?
> 
> What am I passing in here?  The pointer to the array returned from
> AllocateVideoFrames?  if I copied the array of pointers, is the implementor
> looking for and releasing each element, or is the implementor looking for the
> just the start of the array (the one passed back from AllocateVideoFrames)?
> 
> Also why are we passing in n?  If I allocated 3 frames, what happens when I
pass
> in 2?
> 
> I'm wondering if this would be easier to understand if it worked like
calloc():
>   - AllocateVideoFrame(n) -> a single VideoFrame* that can be accessed at
> indices [0-2]
>   - ReleaseVideoFrame(VideoFrame*) -> pass back in original pointer from
> AllocateVideoFrame
> 

The callback will return with an array of pointers. The receiver should be
copying the array. I'll add that to the documentation.

Release video frame will pass in an array of pointers.

If we do it just like calloc(), it will be easier in to under but it'll be
harder to use. Imagine a filter just want to allocate 3 buffers it needs to have
logic that receives buffer, post a task to decoder thread, queue them, and then
when the count is right switch to the next state. But if you always allocate in
a batch, which the decode engine will, there's no such logic needed. Yes
allocate can be called multiple times, but that's only during dimension change,
in that case you'll release in a batch, and then allocate in a batch, both
thread switching and logic will be easy. I'd like to avoid having too much in
the decode engine just for this.


> Also the documentation still hasn't be updated to explain whether we're allow
to
> call Allocate() as much as we want.  If we are.. then I'm wondering if perhaps
> we should stick with just single Allocate/Release.  If you want three frames,
> fire off 3 allocs + callbacks and wait for them all to finish.  This might be
> over pedantic, but what if we only allocate 2/3 frames -- is it all/nothing? 
> Will the implementor have to free whatever it allocated and return failure
> somehow?

Since the use case is always like this:

Allocate a batch
Release all
Allocate another batch
Release all

What about we do:
Allocate(n, ...);
ReleaseAll(); ?

Powered by Google App Engine
This is Rietveld 408576698