Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit fc61b54

Browse files
authored
Add input stream codec parameter to plugin (#907)
1 parent f3163fb commit fc61b54

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

source/agent/analytics/videoGstPipeline/VideoGstAnalyzer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ int VideoGstAnalyzer::createPipeline() {
175175
{"inputwidth", std::to_string(width)},
176176
{"inputheight", std::to_string(height)},
177177
{"inputframerate", std::to_string(framerate)},
178+
{"inputcodec", codec},
178179
{"pipelinename", algo} };
179180
pipeline_->PipelineConfig(plugin_config_map);
180181

source/agent/plugins/samples/cpu_pipeline/mypipeline.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ rvaStatus MyPipeline::PipelineConfig(std::unordered_map<std::string, std::string
3636
else
3737
inputframerate = std::atoi(framerate->second.c_str());
3838

39+
std::unordered_map<std::string,std::string>::const_iterator codec = params.find ("inputcodec");
40+
if ( codec == params.end() )
41+
std::cout << "inputcodec is not found" << std::endl;
42+
else
43+
inputcodec = codec->second;
44+
3945
std::unordered_map<std::string,std::string>::const_iterator name = params.find ("pipelinename");
4046
if ( name == params.end() )
4147
std::cout << "pipeline name is not found" << std::endl;

source/agent/plugins/samples/cpu_pipeline/mypipeline.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class MyPipeline : public rvaPipeline {
3232
private:
3333
GstElement *pipeline, *source, *receive,*detect,*decodebin,*postproc,*h264parse,*counter, *watermark, *converter, *encoder, *outsink;
3434
int inputwidth, inputheight, inputframerate;
35+
std::string inputcodec;
3536
std::string pipelinename;
3637
};
3738

0 commit comments

Comments
 (0)