Support video capture during playback
[platform/core/multimedia/esplusplayer.git] / include / esplusplayer_capi / buffer.h
1 /**
2  * @file
3  * @brief          The buffer for playback.
4  * @interfacetype  Platform
5  * @privlevel      None-privilege
6  * @privilege      None
7  * @product        TV, AV, B2B
8  * @version        2.0
9  * @SDK_Support    N
10  * @remark         This is a group of C style buffer related enum.
11  * @see            N/A
12  *
13  * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
14  * PROPRIETARY/CONFIDENTIAL
15  * This software is the confidential and proprietary
16  * information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall
17  * not disclose such Confidential Information and shall use it only in
18  * accordance with the terms of the license agreement you entered into with
19  * SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the
20  * suitability of the software, either express or implied, including but not
21  * limited to the implied warranties of merchantability, fitness for a
22  * particular purpose, or non-infringement. SAMSUNG shall not be liable for any
23  * damages suffered by licensee as a result of using, modifying or distributing
24  * this software or its derivatives.
25  */
26
27 #ifndef __PLUSPLAYER_ESPLUSPLAYER_CAPI_BUFFER_H__
28 #define __PLUSPLAYER_ESPLUSPLAYER_CAPI_BUFFER_H__
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #include <stdint.h>
35
36 /**
37  * @brief  Enumerations for the buffer status
38  */
39 typedef enum {
40   ESPLUSPLAYER_BUFFER_STATUS_UNDERRUN,
41   ESPLUSPLAYER_BUFFER_STATUS_OVERRUN
42 } esplusplayer_buffer_status;
43
44 /**
45  * @brief  Enumerations for video decoded buffer type
46  * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE:
47  * decoded video frame will be croped and scaled, then sent to
48  * user by media_packet_video_decoded_cb, only support hw decoder now
49 */
50 typedef enum {
51   ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE,
52   ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_COPY,
53   ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_REFERENCE,
54   ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE,
55   ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_MANUAL_COPY
56 } esplusplayer_decoded_video_frame_buffer_type;
57
58 /**
59  * @brief  Enumerations for buffer size option
60  * MAX_TIME_SIZE: The maximum amount of data to esplusplayer internally(in ms)
61  * MIN_TIME_THRESHOLD : Emit under-run when queued bytes drops below this
62  * percent of max-time-size(size%)
63  * MAX_BYTE_SIZE: The maximum number of bytes to esplusplayer internally
64  * MIN_BYTE_THRESHOLD : Emit under-run when queued bytes drops below this
65  * percent of  max-byte-size(size%)
66  */
67 typedef enum {
68   ESPLUSPLAYER_BUFFER_AUDIO_MAX_TIME_SIZE,
69   ESPLUSPLAYER_BUFFER_VIDEO_MAX_TIME_SIZE,
70   ESPLUSPLAYER_BUFFER_AUDIO_MIN_TIME_THRESHOLD,
71   ESPLUSPLAYER_BUFFER_VIDEO_MIN_TIME_THRESHOLD,
72   ESPLUSPLAYER_BUFFER_AUDIO_MAX_BYTE_SIZE,
73   ESPLUSPLAYER_BUFFER_VIDEO_MAX_BYTE_SIZE,
74   ESPLUSPLAYER_BUFFER_AUDIO_MIN_BYTE_THRESHOLD,
75   ESPLUSPLAYER_BUFFER_VIDEO_MIN_BYTE_THRESHOLD
76 } esplusplayer_buffer_option;
77
78 /**
79  * @brief  video decoded buffer struct
80  */
81 typedef struct {
82   /**
83    * @description   buffer pts, in millisecond
84    */
85   uint64_t pts;
86   /**
87    * @description   buffer duration, in millisecond
88    */
89   uint64_t duration;
90   /**
91    * @description   surface data
92    */
93   void* surface_data;
94   /**
95    * @description   the scaler index,0 1 ...
96    */
97   void* private_data;
98 } esplusplayer_decoded_video_packet;
99
100 #ifdef __cplusplus
101 }  // extern "C"
102 #endif
103
104 #endif  // __PLUSPLAYER_ESPLUSPLAYER_CAPI_BUFFER_H__