rocprofiler-sdk/rocdecode/api_args.h Source File

rocprofiler-sdk/rocdecode/api_args.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/rocdecode/api_args.h Source File
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
api_args.h
1// MIT License
2//
3// Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22
23#pragma once
24
25#include <rocprofiler-sdk/defines.h>
26#include <rocprofiler-sdk/rocdecode/api_trace.h>
27
28#include <rocprofiler-sdk/rocdecode/details/rocdecode_headers.h>
29
30#if ROCPROFILER_SDK_USE_SYSTEM_ROCDECODE > 0
31# include <rocdecode/roc_bitstream_reader.h>
32# include <rocdecode/rocdecode.h>
33# include <rocdecode/rocparser.h>
34#else
35# include <rocprofiler-sdk/rocdecode/details/roc_bitstream_reader.h>
36# include <rocprofiler-sdk/rocdecode/details/rocdecode.h>
37# include <rocprofiler-sdk/rocdecode/details/rocparser.h>
38#endif
39
40#include <stdint.h>
41
42ROCPROFILER_EXTERN_C_INIT
43
44// Empty struct has a size of 0 in C but size of 1 in C++.
45// This struct is added to the union members which represent
46// functions with no arguments to ensure ABI compatibility
47typedef struct rocprofiler_rocdecode_api_no_args
48{
49 char empty;
50} rocprofiler_rocdecode_api_no_args;
51
52typedef union rocprofiler_rocdecode_api_retval_t
53{
54 uint64_t uint64_t_retval;
55 int32_t rocDecStatus_retval;
56 const char* const_charp_retval;
57} rocprofiler_rocdecode_api_retval_t;
58
59typedef union rocprofiler_rocdecode_api_args_t
60{
61 struct
62 {
63 RocdecVideoParser* parser_handle;
64 RocdecParserParams* params;
65 } rocDecCreateVideoParser;
66
67 struct
68 {
69 RocdecVideoParser parser_handle;
70 RocdecSourceDataPacket* packet;
71 } rocDecParseVideoData;
72
73 struct
74 {
75 RocdecVideoParser parser_handle;
76 } rocDecDestroyVideoParser;
77
78 struct
79 {
80 rocDecDecoderHandle* decoder_handle;
81 RocDecoderCreateInfo* decoder_create_info;
82 } rocDecCreateDecoder;
83
84 struct
85 {
86 rocDecDecoderHandle decoder_handle;
87 } rocDecDestroyDecoder;
88
89 struct
90 {
91 RocdecDecodeCaps* decode_caps;
92 } rocDecGetDecoderCaps;
93
94 struct
95 {
96 rocDecDecoderHandle decoder_handle;
97 RocdecPicParams* pic_params;
98 } rocDecDecodeFrame;
99
100 struct
101 {
102 rocDecDecoderHandle decoder_handle;
103 int pic_idx;
104 RocdecDecodeStatus* decode_status;
105 } rocDecGetDecodeStatus;
106
107 struct
108 {
109 rocDecDecoderHandle decoder_handle;
110 RocdecReconfigureDecoderInfo* reconfig_params;
111 } rocDecReconfigureDecoder;
112
113 struct
114 {
115 rocDecDecoderHandle decoder_handle;
116 int pic_idx;
117 void** dev_mem_ptr;
118 uint32_t* horizontal_pitch;
119 RocdecProcParams* vid_postproc_params;
120 } rocDecGetVideoFrame;
121 struct
122 {
123 rocDecStatus rocdec_status;
124 } rocDecGetErrorName;
125
126#if ROCDECODE_RUNTIME_API_TABLE_STEP_VERSION >= 1
127 struct
128 {
129 RocdecBitstreamReader* bs_reader_handle;
130 const char* input_file_path;
131 } rocDecCreateBitstreamReader;
132 struct
133 {
134 RocdecBitstreamReader bs_reader_handle;
135 rocDecVideoCodec* codec_type;
136 } rocDecGetBitstreamCodecType;
137 struct
138 {
139 RocdecBitstreamReader bs_reader_handle;
140 int* bit_depth;
141 } rocDecGetBitstreamBitDepth;
142 struct
143 {
144 RocdecBitstreamReader bs_reader_handle;
145 uint8_t** pic_data;
146 int* pic_size;
147 int64_t* pts;
148 } rocDecGetBitstreamPicData;
149 struct
150 {
151 RocdecBitstreamReader bs_reader_handle;
152 } rocDecDestroyBitstreamReader;
153#endif
154} rocprofiler_rocdecode_api_args_t;
155
156ROCPROFILER_EXTERN_C_FINI