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

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

Rocprofiler SDK Developer API: rocprofiler-sdk/rocdecode/details/rocdecode_api_trace.h Source File
Rocprofiler SDK Developer API 0.6.0
ROCm Profiling API and tools
rocdecode_api_trace.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#pragma once
23
24#if !defined(ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE)
25# if defined __has_include
26# if __has_include(<rocdecode/rocparser.h>) && __has_include(<rocdecode/rocdecode.h>) && __has_include(<rocdecode/roc_bitstream_reader.h>)
27# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 1
28# else
29# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
30# endif
31# else
32# define ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE 0
33# endif
34#endif
35
36#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
37# include <rocdecode/roc_bitstream_reader.h>
38# include <rocdecode/rocdecode.h>
39# include <rocdecode/rocparser.h>
40#else
44#endif
45
46// Define version macros for the rocDecode API dispatch table, specifying the MAJOR and STEP
47// versions.
48//
49// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
50//
51// 1. When adding new functions to the rocDecode API dispatch table, always append the new function
52// pointer
53// to the end of the table and increment the dispatch table's version number. Never rearrange the
54// order of the member variables in the dispatch table, as doing so will break the Application
55// Binary Interface (ABI).
56// 2. In critical situations where the type of an existing member variable in a dispatch table has
57// been changed
58// or removed due to a data type modification, it is important to increment the major version
59// number of the rocDecode API dispatch table. If the function pointer type can no longer be
60// declared, do not remove it. Instead, change the function pointer type to `void*` and ensure it
61// is always initialized to `nullptr`.
62//
63// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
64//
65
66// The major version number should ideally remain unchanged. Increment the
67// ROCDECODE_RUNTIME_API_TABLE_MAJOR_VERSION only for fundamental changes to the
68// rocDecodeDispatchTable struct, such as altering the type or name of an existing member variable.
69// Please DO NOT REMOVE it.
70#define ROCDECODE_RUNTIME_API_TABLE_MAJOR_VERSION 0
71
72// Increment the ROCDECODE_RUNTIME_API_TABLE_STEP_VERSION when new runtime API functions are added.
73// If the corresponding ROCDECODE_RUNTIME_API_TABLE_MAJOR_VERSION increases reset the
74// ROCDECODE_RUNTIME_API_TABLE_STEP_VERSION to zero.
75#define ROCDECODE_RUNTIME_API_TABLE_STEP_VERSION 1
76
77// rocDecode API interface
79 RocdecParserParams* params);
84 RocDecoderCreateInfo* decoder_create_info);
88 RocdecPicParams* pic_params);
90 int pic_idx,
91 RocdecDecodeStatus* decode_status);
93 rocDecDecoderHandle decoder_handle,
94 RocdecReconfigureDecoderInfo* reconfig_params);
96 int pic_idx,
97 void* dev_mem_ptr[3],
98 uint32_t* horizontal_pitch,
99 RocdecProcParams* vid_postproc_params);
100typedef const char*(ROCDECAPI* PfnRocDecGetErrorName)(rocDecStatus rocdec_status);
102 RocdecBitstreamReader* bs_reader_handle,
103 const char* input_file_path);
105 RocdecBitstreamReader bs_reader_handle,
106 rocDecVideoCodec* codec_type);
108 RocdecBitstreamReader bs_reader_handle,
109 int* bit_depth);
111 RocdecBitstreamReader bs_reader_handle,
112 uint8_t** pic_data,
113 int* pic_size,
114 int64_t* pts);
116 RocdecBitstreamReader bs_reader_handle);
117
118// rocDecode API dispatch table
120{
121 // ROCDECODE_RUNTIME_API_TABLE_STEP_VERSION == 0
122 size_t size;
134 // PLEASE DO NOT EDIT ABOVE!
135 // ROCDECODE_RUNTIME_API_TABLE_STEP_VERSION == 1
141 // PLEASE DO NOT EDIT ABOVE!
142 // ROCDECODE_RUNTIME_API_TABLE_STEP_VERSION == 2
143
144 // *******************************************************************************************
145 // //
146 // READ BELOW
147 // *******************************************************************************************
148 // // Please keep this text at the end of the structure:
149
150 // 1. Do not reorder any existing members.
151 // 2. Increase the step version definition before adding new members.
152 // 3. Insert new members under the appropriate step version comment.
153 // 4. Generate a comment for the next step version.
154 // 5. Add a "PLEASE DO NOT EDIT ABOVE!" comment.
155 // *******************************************************************************************
156 // //
157};
This structure is used in rocDecCreateDecoder API.
Definition rocdecode.h:206
This structure is used in rocDecGetDecoderCaps API.
Definition rocdecode.h:182
Struct for reporting decode status. This structure is used in RocdecGetDecodeStatus API.
Definition rocdecode.h:257
Picture parameters for postprocessing This structure is used in rocDecGetVideoFrame API.
Definition rocdecode.h:1781
Struct for decoder reset This structure is used in rocDecReconfigureDecoder() API.
Definition rocdecode.h:270
The AMD rocDecode library.\Used in rocDecCreateVideoParser API.
Definition rocparser.h:283
Data Packet Used in rocDecParseVideoData API IN for rocDecParseVideoData.
Definition rocparser.h:185
The AMD rocBitstreamReader Library.
void * RocdecBitstreamReader
HANDLE of rocBitstreamReader Used in subsequent API calls after rocDecCreateBitstreamReader.
The AMD rocDecode Library.
rocDecStatus
Definition rocdecode.h:78
rocDecVideoCodec
Definition rocdecode.h:97
void * rocDecDecoderHandle
HANDLE pf rocDecDecoder Used in subsequent API calls after rocDecCreateDecoder.
Definition rocdecode.h:69
#define ROCDECAPI
Definition rocdecode.h:29
rocDecStatus(ROCDECAPI * PfnRocDecCreateVideoParser)(RocdecVideoParser *parser_handle, RocdecParserParams *params)
PfnRocDecGetBitstreamPicData pfn_rocdec_get_bitstream_pic_data
PfnRocDecDestroyDecoder pfn_rocdec_destroy_decoder
PfnRocDecGetVideoFrame pfn_rocdec_get_video_frame
rocDecStatus(ROCDECAPI * PfnRocDecCreateBitstreamReader)(RocdecBitstreamReader *bs_reader_handle, const char *input_file_path)
PfnRocDecDestroyVideoParser pfn_rocdec_destroy_video_parser
rocDecStatus(ROCDECAPI * PfnRocDecDestroyDecoder)(rocDecDecoderHandle decoder_handle)
rocDecStatus(ROCDECAPI * PfnRocDecParseVideoData)(RocdecVideoParser parser_handle, RocdecSourceDataPacket *packet)
PfnRocDecReconfigureDecoder pfn_rocdec_reconfigure_decoder
rocDecStatus(ROCDECAPI * PfnRocDecReconfigureDecoder)(rocDecDecoderHandle decoder_handle, RocdecReconfigureDecoderInfo *reconfig_params)
PfnRocDecParseVideoData pfn_rocdec_parse_video_data
PfnRocDecGetBitstreamBitDepth pfn_rocdec_get_bitstream_bit_depth
PfnRocDecGetBitstreamCodecType pfn_rocdec_get_bitstream_codec_type
rocDecStatus(ROCDECAPI * PfnRocDecDestroyBitstreamReader)(RocdecBitstreamReader bs_reader_handle)
rocDecStatus(ROCDECAPI * PfnRocDecGetBitstreamPicData)(RocdecBitstreamReader bs_reader_handle, uint8_t **pic_data, int *pic_size, int64_t *pts)
rocDecStatus(ROCDECAPI * PfnRocDecDecodeFrame)(rocDecDecoderHandle decoder_handle, RocdecPicParams *pic_params)
PfnRocDecCreateBitstreamReader pfn_rocdec_create_bitstream_reader
PfnRocDecDestroyBitstreamReader pfn_rocdec_destroy_bitstream_reader
PfnRocDecGetDecodeStatus pfn_rocdec_get_decode_status
const char *(ROCDECAPI * PfnRocDecGetErrorName)(rocDecStatus rocdec_status)
PfnRocDecDecodeFrame pfn_rocdec_decode_frame
rocDecStatus(ROCDECAPI * PfnRocDecDestroyVideoParser)(RocdecVideoParser parser_handle)
PfnRocDecCreateDecoder pfn_rocdec_create_decoder
rocDecStatus(ROCDECAPI * PfnRocDecGetBitstreamCodecType)(RocdecBitstreamReader bs_reader_handle, rocDecVideoCodec *codec_type)
rocDecStatus(ROCDECAPI * PfnRocDecGetBitstreamBitDepth)(RocdecBitstreamReader bs_reader_handle, int *bit_depth)
rocDecStatus(ROCDECAPI * PfnRocDecGetDecodeStatus)(rocDecDecoderHandle decoder_handle, int pic_idx, RocdecDecodeStatus *decode_status)
PfnRocDecGetErrorName pfn_rocdec_get_error_name
rocDecStatus(ROCDECAPI * PfnRocDecGetVideoFrame)(rocDecDecoderHandle decoder_handle, int pic_idx, void *dev_mem_ptr[3], uint32_t *horizontal_pitch, RocdecProcParams *vid_postproc_params)
PfnRocDecCreateVideoParser pfn_rocdec_create_video_parser
rocDecStatus(ROCDECAPI * PfnRocDecGetDecoderCaps)(RocdecDecodeCaps *decode_caps)
rocDecStatus(ROCDECAPI * PfnRocDecCreateDecoder)(rocDecDecoderHandle *decoder_handle, RocDecoderCreateInfo *decoder_create_info)
PfnRocDecGetDecoderCaps pfn_rocdec_get_gecoder_caps
The AMD rocParser Library.
void * RocdecVideoParser
HANDLE pf rocDecDecoder Used in subsequent API calls after rocDecCreateDecoder.
Definition rocparser.h:62