1/* Copyright (c) 2012 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 6/** 7 * NOTE: these must be kept in sync with the versions in media/! 8 */ 9 10 11/** 12 * Video format. 13 * 14 * Keep the values in this enum unique, as they imply format (h.264 vs. VP8, 15 * for example), and keep the values for a particular format grouped together 16 * for clarity. 17 * Note: Keep these in sync with media::VideoCodecProfile. 18 */ 19[assert_size(4)] 20enum PP_VideoDecoder_Profile { 21 PP_VIDEODECODER_PROFILE_UNKNOWN = -1, 22 PP_VIDEODECODER_H264PROFILE_NONE = 0, 23 PP_VIDEODECODER_H264PROFILE_BASELINE = 1, 24 PP_VIDEODECODER_H264PROFILE_MAIN = 2, 25 PP_VIDEODECODER_H264PROFILE_EXTENDED = 3, 26 PP_VIDEODECODER_H264PROFILE_HIGH = 4, 27 PP_VIDEODECODER_H264PROFILE_HIGH10PROFILE = 5, 28 PP_VIDEODECODER_H264PROFILE_HIGH422PROFILE = 6, 29 PP_VIDEODECODER_H264PROFILE_HIGH444PREDICTIVEPROFILE = 7, 30 PP_VIDEODECODER_H264PROFILE_SCALABLEBASELINE = 8, 31 PP_VIDEODECODER_H264PROFILE_SCALABLEHIGH = 9, 32 PP_VIDEODECODER_H264PROFILE_STEREOHIGH = 10, 33 PP_VIDEODECODER_H264PROFILE_MULTIVIEWHIGH = 11, 34 PP_VIDEODECODER_VP8PROFILE_ANY = 12 35}; 36 37/** 38 * The data structure for video bitstream buffer. 39 */ 40[assert_size(12)] 41struct PP_VideoBitstreamBuffer_Dev { 42 /** 43 * Client-specified identifier for the bitstream buffer. Valid values are 44 * non-negative. 45 */ 46 int32_t id; 47 48 /** 49 * Buffer to hold the bitstream data. Should be allocated using the 50 * PPB_Buffer interface for consistent interprocess behaviour. 51 */ 52 PP_Resource data; 53 54 /** 55 * Size of the bitstream contained in buffer (in bytes). 56 */ 57 uint32_t size; 58}; 59 60/** 61 * Struct for specifying texture-backed picture data. 62 */ 63[assert_size(16)] 64struct PP_PictureBuffer_Dev { 65 /** 66 * Client-specified id for the picture buffer. By using this value client can 67 * keep track of the buffers it has assigned to the video decoder and how they 68 * are passed back to it. Valid values are non-negative. 69 */ 70 int32_t id; 71 72 /** 73 * Dimensions of the buffer. 74 */ 75 PP_Size size; 76 77 /** 78 * Texture ID in the given context where picture is stored. 79 */ 80 uint32_t texture_id; 81}; 82 83/** 84 * Structure to describe a decoded output frame. 85 */ 86[assert_size(8)] 87struct PP_Picture_Dev { 88 /** 89 * ID of the picture buffer where the picture is stored. 90 */ 91 int32_t picture_buffer_id; 92 93 /** 94 * ID of the bitstream from which this data was decoded. 95 */ 96 int32_t bitstream_buffer_id; 97}; 98 99/** 100 * Decoder error codes reported to the plugin. A reasonable naive 101 * error handling policy is for the plugin to Destroy() the decoder on error. 102 */ 103[assert_size(4)] 104enum PP_VideoDecodeError_Dev { 105 /** 106 * An operation was attempted during an incompatible decoder state. 107 */ 108 PP_VIDEODECODERERROR_ILLEGAL_STATE = 1, 109 110 /** 111 * Invalid argument was passed to an API method. 112 */ 113 PP_VIDEODECODERERROR_INVALID_ARGUMENT = 2, 114 115 /** 116 * Encoded input is unreadable. 117 */ 118 PP_VIDEODECODERERROR_UNREADABLE_INPUT = 3, 119 120 /** 121 * A failure occurred at the browser layer or lower. Examples of such 122 * failures include GPU hardware failures, GPU driver failures, GPU library 123 * failures, browser programming errors, and so on. 124 */ 125 PP_VIDEODECODERERROR_PLATFORM_FAILURE = 4 126}; 127