rocprofiler-sdk/rocdecode/details/roc_bitstream_reader.h Source File

rocprofiler-sdk/rocdecode/details/roc_bitstream_reader.h Source File#

Rocprofiler SDK Developer API: rocprofiler-sdk/rocdecode/details/roc_bitstream_reader.h Source File
Rocprofiler SDK Developer API 0.6.0
ROCm Profiling API and tools
roc_bitstream_reader.h
Go to the documentation of this file.
1/*
2Copyright (c) 2024 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20THE SOFTWARE.
21*/
22
23#pragma once
24
25#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
26# if defined __has_include
27# if __has_include(<rocdecode/rocdecode.h>)
28# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 1
29# else
30# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
31# endif
32# else
33# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
34# endif
35#endif
36
37#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
38# include <rocdecode/rocdecode.h>
39#else
41#endif
42
43/*!
44 * \file
45 * \brief The AMD rocBitstreamReader Library.
46 *
47 * \defgroup group_roc_bitstream_reader rocDecode Parser: AMD ROCm Video Bitstream Reader API
48 * \brief AMD The rocBitstreamReader is a toolkit to read picture data from bitstream files for
49 * decoding on AMD’s GPUs.
50 */
51
52#if defined(__cplusplus)
53extern "C" {
54#endif /* __cplusplus */
55
56/*********************************************************************************/
57//! HANDLE of rocBitstreamReader
58//! Used in subsequent API calls after rocDecCreateBitstreamReader
59/*********************************************************************************/
61
62/************************************************************************************************/
63//! \ingroup group_roc_bitstream_reader
64//! \fn rocDecStatus ROCDECAPI rocDecCreateBitstreamReader(RocdecBitstreamReader *bs_reader_handle,
65//! const char *input_file_path) Create video bitstream reader object and initialize
66/************************************************************************************************/
68rocDecCreateBitstreamReader(RocdecBitstreamReader* bs_reader_handle, const char* input_file_path);
69
70/************************************************************************************************/
71//! \ingroup group_roc_bitstream_reader
72//! \fn rocDecStatus ROCDECAPI rocDecGetBitstreamCodecType(RocdecBitstreamReader bs_reader_handle,
73//! rocDecVideoCodec *codec_type) Get the codec type of the bitstream
74/************************************************************************************************/
77
78/************************************************************************************************/
79//! \ingroup group_roc_bitstream_reader
80//! \fn rocDecStatus ROCDECAPI rocDecGetBitstreamBitDepth(RocdecBitstreamReader bs_reader_handle,
81//! int *bit_depth) Get the bit depth of the bitstream
82/************************************************************************************************/
84rocDecGetBitstreamBitDepth(RocdecBitstreamReader bs_reader_handle, int* bit_depth);
85
86/************************************************************************************************/
87//! \ingroup group_roc_bitstream_reader
88//! \fn rocDecStatus ROCDECAPI rocDecGetBitstreamPicData(RocdecBitstreamReader bs_reader_handle,
89//! uint8_t **pic_data, int *pic_size, int64_t *pts) Read one unit of picture data from the
90//! bitstream. The unit can be a frame or field for AVC/HEVC, a temporal unit for AV1, or a frame
91//! (including superframe) for VP9. The picture data unit is pointed by pic_data. The size of the
92//! unit is specified by pic_size. The presentation time stamp, if available, is given by pts.
93/************************************************************************************************/
96 uint8_t** pic_data,
97 int* pic_size,
98 int64_t* pts);
99
100/************************************************************************************************/
101//! \ingroup group_roc_bitstream_reader
102//! \fn rocDecStatus ROCDECAPI rocDecDestroyBitstreamReader(RocdecBitstreamReader bs_reader_handle)
103//! Destroy the video parser object
104/************************************************************************************************/
107
108#if defined(__cplusplus)
109}
110#endif /* __cplusplus */
rocDecStatus ROCDECAPI rocDecGetBitstreamCodecType(RocdecBitstreamReader bs_reader_handle, rocDecVideoCodec *codec_type)
rocDecStatus ROCDECAPI rocDecGetBitstreamPicData(RocdecBitstreamReader bs_reader_handle, uint8_t **pic_data, int *pic_size, int64_t *pts)
rocDecStatus ROCDECAPI rocDecGetBitstreamBitDepth(RocdecBitstreamReader bs_reader_handle, int *bit_depth)
rocDecStatus ROCDECAPI rocDecCreateBitstreamReader(RocdecBitstreamReader *bs_reader_handle, const char *input_file_path)
void * RocdecBitstreamReader
HANDLE of rocBitstreamReader Used in subsequent API calls after rocDecCreateBitstreamReader.
rocDecStatus ROCDECAPI rocDecDestroyBitstreamReader(RocdecBitstreamReader bs_reader_handle)
The AMD rocDecode Library.
rocDecStatus
Definition rocdecode.h:78
rocDecVideoCodec
Definition rocdecode.h:97
#define ROCDECAPI
Definition rocdecode.h:29