-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix cleanup methods, and use instance based stuff for a lot of things
- Loading branch information
Avi Saranga
committed
Jul 23, 2018
1 parent
c4c1658
commit 0efa16f
Showing
3 changed files
with
113 additions
and
119 deletions.
There are no files selected for viewing
116 changes: 49 additions & 67 deletions
116
module/src/server/implementation/objects/TelmateFrameGrabberImpl.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,101 @@ | ||
/* Autogenerated with kurento-module-creator */ | ||
|
||
#include <gst/gst.h> | ||
#include <string> | ||
#include "MediaPipeline.hpp" | ||
#include <TelmateFrameGrabberImplFactory.hpp> | ||
#include "TelmateFrameGrabberImpl.hpp" | ||
#include <jsonrpc/JsonSerializer.hpp> | ||
#include <KurentoException.hpp> | ||
#include "MediaPipelineImpl.hpp" | ||
|
||
|
||
#define GST_CAT_DEFAULT kurento_telmate_frame_grabber_impl | ||
GST_DEBUG_CATEGORY_STATIC(GST_CAT_DEFAULT); | ||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); | ||
#define GST_DEFAULT_NAME "KurentoTelmateFrameGrabberImpl" | ||
|
||
namespace kurento { | ||
namespace module { | ||
namespace telmate { | ||
|
||
TelmateFrameGrabberImpl::TelmateFrameGrabberImpl( | ||
const boost::property_tree::ptree &config, | ||
std::shared_ptr<MediaPipeline> mediaPipeline) : | ||
OpenCVFilterImpl(config, | ||
std::dynamic_pointer_cast<MediaPipelineImpl> (mediaPipeline)) { | ||
namespace kurento | ||
{ | ||
namespace module | ||
{ | ||
namespace telmateframegrabber | ||
{ | ||
|
||
GST_DEBUG("TelmateFrameGrabberImpl::" | ||
"TelmateFrameGrabberImpl() " | ||
"called, %s ", this->epName.c_str()); | ||
TelmateFrameGrabberImpl::TelmateFrameGrabberImpl (const boost::property_tree::ptree &config, | ||
std::shared_ptr<MediaPipeline> mediaPipeline) : | ||
OpenCVFilterImpl (config, std::dynamic_pointer_cast<MediaPipelineImpl> (mediaPipeline) ) | ||
|
||
{ | ||
|
||
g_object_set (element, "filter-factory", "opencvfilter", NULL); | ||
g_object_set (element, "filter-factory", "telmateframegrabberopencvimpl", NULL); | ||
g_object_get (G_OBJECT (element), "filter", &telmateframegrabberopencvimpl, NULL); | ||
|
||
g_object_get (G_OBJECT (element), "filter", &opencvfilter, NULL); | ||
|
||
if (opencvfilter == nullptr) { | ||
if (telmateframegrabberopencvimpl == nullptr) { | ||
throw KurentoException (MEDIA_OBJECT_NOT_AVAILABLE, | ||
"Media Object not available"); | ||
} | ||
|
||
g_object_set (opencvfilter, "target-object", | ||
g_object_set (telmateframegrabberopencvimpl, "target-object", | ||
static_cast<kurento::TelmateFrameGrabberOpenCVImpl *> (this), NULL); | ||
|
||
g_object_unref (opencvfilter); | ||
g_object_unref (telmateframegrabberopencvimpl); | ||
|
||
pTelmateFrameGrabberOpenCVImpl = (TelmateFrameGrabberOpenCVImpl*) telmateframegrabberopencvimpl; | ||
|
||
} | ||
|
||
TelmateFrameGrabberImpl::~TelmateFrameGrabberImpl() { | ||
|
||
|
||
|
||
int TelmateFrameGrabberImpl::cleanup() | ||
{ | ||
pTelmateFrameGrabberOpenCVImpl->cleanup(); | ||
return 1; | ||
} | ||
void TelmateFrameGrabberImpl::release() { | ||
|
||
std::shared_ptr<MediaObject> p = TelmateFrameGrabberOpenCVImpl::getSharedPtr(); | ||
p.reset(); | ||
|
||
GST_DEBUG("TelmateFrameGrabberImpl::" | ||
"release() " | ||
"called, %s ", this->epName.c_str()); | ||
return; | ||
int TelmateFrameGrabberImpl::getSnapInterval () | ||
{ | ||
return pTelmateFrameGrabberOpenCVImpl->snapInterval; | ||
} | ||
|
||
|
||
void TelmateFrameGrabberImpl::cleanup() { | ||
|
||
TelmateFrameGrabberOpenCVImpl *p = (TelmateFrameGrabberOpenCVImpl*) opencvfilter; | ||
p->cleanup(); | ||
void TelmateFrameGrabberImpl::setSnapInterval (int snapInterval) | ||
{ | ||
pTelmateFrameGrabberOpenCVImpl->snapInterval = snapInterval; | ||
return; | ||
} | ||
|
||
int TelmateFrameGrabberImpl::getSnapInterval() { | ||
return TelmateFrameGrabberOpenCVImpl::snapInterval; | ||
} | ||
|
||
|
||
void TelmateFrameGrabberImpl::setSnapInterval(int snapInterval) { | ||
TelmateFrameGrabberOpenCVImpl::snapInterval = snapInterval; | ||
return; | ||
std::string TelmateFrameGrabberImpl::getStoragePath () | ||
{ | ||
return pTelmateFrameGrabberOpenCVImpl->storagePath; | ||
} | ||
|
||
void TelmateFrameGrabberImpl::setOutputFormat(int outputFormat) { | ||
TelmateFrameGrabberOpenCVImpl::outputFormat = outputFormat; | ||
return; | ||
} | ||
std::string TelmateFrameGrabberImpl::getStoragePath() { | ||
return TelmateFrameGrabberOpenCVImpl::storagePath; | ||
void TelmateFrameGrabberImpl::setStoragePath (const std::string &path) | ||
{ | ||
pTelmateFrameGrabberOpenCVImpl->storagePath = path; | ||
} | ||
|
||
void TelmateFrameGrabberImpl::setStoragePath(const std::string &path) { | ||
TelmateFrameGrabberOpenCVImpl::storagePath = path; | ||
void TelmateFrameGrabberImpl::setWebRtcEpName (const std::string &epName) | ||
{ | ||
pTelmateFrameGrabberOpenCVImpl->epName = epName; | ||
return; | ||
} | ||
|
||
void TelmateFrameGrabberImpl::setWebRtcEpName(const std::string &epName) { | ||
TelmateFrameGrabberOpenCVImpl::epName = epName; | ||
void TelmateFrameGrabberImpl::setOutputFormat (int outputFormat) | ||
{ | ||
pTelmateFrameGrabberOpenCVImpl->outputFormat = outputFormat; | ||
return; | ||
} | ||
|
||
MediaObjectImpl * | ||
TelmateFrameGrabberImplFactory::createObject( | ||
const boost::property_tree::ptree &config, | ||
std::shared_ptr<MediaPipeline> mediaPipeline) const { | ||
|
||
return new TelmateFrameGrabberImpl(config, mediaPipeline); | ||
TelmateFrameGrabberImplFactory::createObject (const boost::property_tree::ptree &config, std::shared_ptr<MediaPipeline> mediaPipeline) const | ||
{ | ||
return new TelmateFrameGrabberImpl (config, mediaPipeline); | ||
} | ||
|
||
TelmateFrameGrabberImpl::StaticConstructor | ||
TelmateFrameGrabberImpl::staticConstructor; | ||
TelmateFrameGrabberImpl::StaticConstructor TelmateFrameGrabberImpl::staticConstructor; | ||
|
||
TelmateFrameGrabberImpl::StaticConstructor::StaticConstructor() { | ||
GST_DEBUG_CATEGORY_INIT(GST_CAT_DEFAULT, GST_DEFAULT_NAME, 0, | ||
TelmateFrameGrabberImpl::StaticConstructor::StaticConstructor() | ||
{ | ||
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, GST_DEFAULT_NAME, 0, | ||
GST_DEFAULT_NAME); | ||
} | ||
|
||
} // namespace telmat | ||
} // namespace module | ||
} // namespace kurento | ||
} /* telmateframegrabber */ | ||
} /* module */ | ||
} /* kurento */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters