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

Side by Side Diff: media/video/video_decode_context.h

Issue 3233003: Add a VideoDecodeContext that provides resources for a VideoDecodeEngine (Closed)
Patch Set: updated API Created 10 years, 3 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
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_
6 #define MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_
7
8 #include "base/callback.h"
9
10 namespace media {
11
12 class VideoFrame;
13
14 // A VideoDecodeContext provides resources like output video frame storage and
15 // hardware decoder handle to a VideoDecodeEngine, it hides all the platform and
16 // subsystem details from the decode engine.
17 class VideoDecodeContext {
18 public:
19 typedef Callback2<int, VideoFrame*[]>::Type AllocationCompleteCallback;
20 typedef Callback0::Type DestructionCompleteCallback;
21
22 virtual ~VideoDecodeContext() {};
23
24 // Obtain a handle to the hardware video decoder device. The type of the
25 // handle is a contract between the implementation of VideoDecodeContext and
26 // VideoDecodeEngine.
27 //
28 // If a hardware device is not needed this method should return NULL.
29 virtual void* GetDevice() = 0;
30
31 // Allocate |n| video frames with dimension |width| and |height|. |callback|
32 // is called when allocation has completed.
33 virtual void AllocateVideoFrames(int n, size_t width, size_t height,
34 AllocationCompleteCallback* callback) = 0;
35
36 // Release video frames allocated by the context. After making this call
37 // VideoDecodeEngine should not use the VideoFrame allocated because they
38 // could be destroyed.
39 virtual void ReleaseVideoFrames(int n, VideoFrame* frames) = 0;
scherkus (not reviewing) 2010/09/03 17:50:14 this is still a bit clumsy so AllocateVideoFrames
40
41 // Destroy this context asynchronously. When the operation is done |callback|
42 // is called.
43 //
44 // ReleaseVideoFrames() need to be called with all the video frames allocated
45 // before making this call.
46 virtual void Destroy(DestructionCompleteCallback* callback) = 0;
47 };
48
49 } // namespace media
50
51 #endif // MEDIA_VIDEO_VIDEO_DECODE_CONTEXT_H_
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698