clang optimizations and improved error handling
This commit is contained in:
@@ -74,7 +74,7 @@ bool GStreamerPipeline::start() {
|
||||
|
||||
// Set callbacks
|
||||
std::cout << "[DEBUG] Setting appsrc callbacks..." << std::endl;
|
||||
GstAppSrcCallbacks callbacks;
|
||||
GstAppSrcCallbacks callbacks = {};
|
||||
callbacks.need_data = onNeedData;
|
||||
callbacks.enough_data = onEnoughData;
|
||||
callbacks.seek_data = nullptr;
|
||||
@@ -82,7 +82,7 @@ bool GStreamerPipeline::start() {
|
||||
|
||||
// Start the pipeline
|
||||
std::cout << "[DEBUG] Setting pipeline state to PLAYING..." << std::endl;
|
||||
GstStateChangeReturn ret = gst_element_set_state(pipeline_, GST_STATE_PLAYING);
|
||||
const GstStateChangeReturn ret = gst_element_set_state(pipeline_, GST_STATE_PLAYING);
|
||||
if (ret == GST_STATE_CHANGE_FAILURE) {
|
||||
std::cerr << "[ERROR] Failed to set pipeline state to PLAYING" << std::endl;
|
||||
gst_object_unref(appsrc_);
|
||||
@@ -194,7 +194,7 @@ bool GStreamerPipeline::pushBuffer(const uint8_t* data, const size_t size, const
|
||||
gst_buffer_unmap(buffer, &map);
|
||||
|
||||
// Push buffer to pipeline
|
||||
GstFlowReturn ret = gst_app_src_push_buffer(GST_APP_SRC(appsrc_), buffer);
|
||||
const GstFlowReturn ret = gst_app_src_push_buffer(GST_APP_SRC(appsrc_), buffer);
|
||||
if (ret != GST_FLOW_OK) {
|
||||
std::cerr << "[ERROR] Failed to push buffer to pipeline, flow return: " << ret << std::endl;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user