Support video capture during playback
[platform/core/multimedia/esplusplayer.git] / include / plusplayer / types / buffer.h
1 /**
2  * @file
3  * @brief          the buffer for playback
4  * @interfacetype  Module
5  * @privlevel      None-privilege
6  * @privilege      None
7  * @product        TV, AV, B2B
8  * @version        0.0.1
9  * @SDK_Support    N
10  *
11  * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
12  * PROPRIETARY/CONFIDENTIAL
13  * This software is the confidential and proprietary
14  * information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall
15  * not disclose such Confidential Information and shall use it only in
16  * accordance with the terms of the license agreement you entered into with
17  * SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the
18  * suitability of the software, either express or implied, including but not
19  * limited to the implied warranties of merchantability, fitness for a
20  * particular purpose, or non-infringement. SAMSUNG shall not be liable for any
21  * damages suffered by licensee as a result of using, modifying or distributing
22  * this software or its derivatives.
23  */
24 #ifndef __PLUSPLAYER_TYPES_BUFFER_H__
25 #define __PLUSPLAYER_TYPES_BUFFER_H__
26
27 #include <cstdint>
28
29 #include "tbm_type.h"
30
31 namespace plusplayer {
32
33 /**
34  * @brief  Enumerations for the buffer status
35  */
36 enum class BufferStatus { kUnderrun, kOverrun };
37
38 enum class DecodedVideoFrameBufferType { kNone, kCopy, kReference, kScale };
39
40 enum class BufferOption {
41   kBufferAudioMaxTimeSize,
42   kBufferVideoMaxTimeSize,
43   kBufferAudioMinTimeThreshold,
44   kBufferVideoMinTimeThreshold,
45   kBufferAudioMaxByteSize,
46   kBufferVideoMaxByteSize,
47   kBufferAudioMinByteThreshold,
48   kBufferVideoMinByteThreshold,
49   kBufferOptionMax
50 };
51
52 struct DecodedVideoPacket {
53   uint64_t pts = 0;
54   uint64_t duration = 0;
55   tbm_surface_h surface_data = nullptr;  // tbm_surface
56   void* buffer_addr = nullptr;
57 };
58
59 struct DecoderBufferTime {
60   uint64_t pts = 0;
61   uint64_t system_time = 0;
62 };
63
64 /**
65  * @brief Enumerations for the state of getting decoded packet
66  */
67 enum class GetDecodedVideoFrameStatus {
68   kSuccess,
69   kNoRemainingBuffer,
70   kNoFilledBuffer,
71   kUnknown,
72 };
73
74 }  // namespace plusplayer
75
76 #endif  // __PLUSPLAYER_TYPES_BUFFER_H__