3ddb12f075
* initial commit * initial implementation for host based decoder * minor change * cmake changes and added new sample * rocdecDecode sample implementation * rocdecode sample changes working * working version of avcodec decoder and sample * Add end of stream handling for repeated decoding with reconfigure * reorg files and added changelog * update readme * revert file * remove unused class members * addressed reviw comment for changelog * fix sample to work on more video files * resolved review comments * bumped version to 0.14.0 * fixed build warnings * addressed review comments * addressed review comments * addressed review comments * fixed readme to match .cpp file options for parameters * updated review comments, readme, and added test data for the sample * fixed bug for saving frame for 10 bit videos * addressed review comments * addressed all the new review comments
45 строки
1.7 KiB
C++
45 строки
1.7 KiB
C++
/*
|
|
Copyright (c) 2023 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "roc_decoder_host.h"
|
|
|
|
/**
|
|
* @brief DecHandle structure
|
|
*
|
|
*/
|
|
struct DecHandleHost {
|
|
|
|
explicit DecHandleHost(RocDecoderHostCreateInfo& decoder_create_info) : roc_decoder_host_(std::make_shared<RocDecoderHost>(decoder_create_info)) {}; //constructor
|
|
~DecHandleHost() { ClearErrors(); }
|
|
std::shared_ptr<RocDecoderHost> roc_decoder_host_;
|
|
bool NoError() { return error_.empty(); }
|
|
const char* ErrorMsg() { return error_.c_str(); }
|
|
void CaptureError(const std::string& err_msg) { error_ = err_msg; }
|
|
|
|
private:
|
|
void ClearErrors() { error_ = "";}
|
|
std::string error_;
|
|
}; |