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

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

Issue 852103002: Revert of Add accelerated video decoder interface, VP8 and H.264 implementations and hook up to V4L2SVDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « content/common/BUILD.gn ('k') | content/common/gpu/media/generic_v4l2_video_device.h » ('j') | 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 2015 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 CONTENT_COMMON_GPU_MEDIA_ACCELERATED_VIDEO_DECODER_
6 #define CONTENT_COMMON_GPU_MEDIA_ACCELERATED_VIDEO_DECODER_
7
8 #include "base/macros.h"
9 #include "content/common/content_export.h"
10 #include "ui/gfx/geometry/size.h"
11
12 namespace content {
13
14 // An AcceleratedVideoDecoder is a video decoder that requires support from an
15 // external accelerator (typically a hardware accelerator) to partially offload
16 // the decode process after parsing stream headers, and performing reference
17 // frame and state management.
18 class CONTENT_EXPORT AcceleratedVideoDecoder {
19 public:
20 AcceleratedVideoDecoder() {}
21 virtual ~AcceleratedVideoDecoder() {}
22
23 virtual void SetStream(const uint8_t* ptr, size_t size) = 0;
24
25 // Have the decoder flush its state and trigger output of all previously
26 // decoded surfaces. Return false on failure.
27 virtual bool Flush() WARN_UNUSED_RESULT = 0;
28
29 // Stop (pause) decoding, discarding all remaining inputs and outputs,
30 // but do not flush decoder state, so that playback can be resumed later,
31 // possibly from a different location.
32 // To be called during decoding.
33 virtual void Reset() = 0;
34
35 enum DecodeResult {
36 kDecodeError, // Error while decoding.
37 // TODO(posciak): unsupported streams are currently treated as error
38 // in decoding; in future it could perhaps be possible to fall back
39 // to software decoding instead.
40 // kStreamError, // Error in stream.
41 kAllocateNewSurfaces, // Need a new set of surfaces to be allocated.
42 kRanOutOfStreamData, // Need more stream data to proceed.
43 kRanOutOfSurfaces, // Waiting for the client to free up output surfaces.
44 };
45
46 // Try to decode more of the stream, returning decoded frames asynchronously.
47 // Return when more stream is needed, when we run out of free surfaces, when
48 // we need a new set of them, or when an error occurs.
49 virtual DecodeResult Decode() WARN_UNUSED_RESULT = 0;
50
51 // Return dimensions/required number of output surfaces that client should
52 // be ready to provide for the decoder to function properly.
53 // To be used after Decode() returns kNeedNewSurfaces.
54 virtual gfx::Size GetPicSize() const = 0;
55 virtual size_t GetRequiredNumOfPictures() const = 0;
56
57 private:
58 DISALLOW_COPY_AND_ASSIGN(AcceleratedVideoDecoder);
59 };
60
61 } // namespace content
62
63 #endif // CONTENT_COMMON_GPU_MEDIA_ACCELERATED_VIDEO_DECODER_
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/gpu/media/generic_v4l2_video_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698