mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Added Stream Discoverer to detect frame size from a gstreamer pipeline
Previous use of Stream are not affected (the discoverer is passively returning the given width and height). But if the Stream is created without dimensions, it will run a discoverer to try to get preroll frames and detect width and height from there.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
**/
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
|
||||
@@ -45,8 +46,11 @@ void GenericStreamSource::setDescription(const std::string &desc)
|
||||
{
|
||||
Log::Notify("Creating Source with Stream description '%s'", desc.c_str());
|
||||
|
||||
std::string pipeline = desc;
|
||||
pipeline.append(" ! queue max-size-buffers=10 ! videoconvert");
|
||||
|
||||
// open gstreamer
|
||||
stream_->open(desc);
|
||||
stream_->open(pipeline);
|
||||
stream_->play(true);
|
||||
|
||||
// will be ready after init and one frame rendered
|
||||
|
||||
Reference in New Issue
Block a user