Skip to content

Commit

Permalink
Auto convert / resample to RGBA (closes sofian#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
sofian committed Jan 8, 2013
1 parent ee34573 commit 656591d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gears/VideoSource/Gear_VideoSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ bool Gear_VideoSource::_videoPull()

video->resize(width, height);

convert24to32((unsigned char*)video->data(), GST_BUFFER_DATA(buffer), video->size());
memcpy(video->data(), GST_BUFFER_DATA(buffer), video->size() * sizeof(RGBA));

// convert24to32((unsigned char*)video->data(), GST_BUFFER_DATA(buffer), video->size());
// Make sure the buffer width / height are right.
// int nPixelsInBuffer = GST_BUFFER_SIZE(buffer) / (bpp / 8);
// int nPixels = width * height;
Expand Down Expand Up @@ -361,7 +363,7 @@ bool Gear_VideoSource::loadMovie(std::string filename)
g_free (audioCapsText);

// Configure video appsink.
GstCaps *videoCaps = gst_caps_from_string ("video/x-raw-rgb");
GstCaps *videoCaps = gst_caps_from_string ("video/x-raw-rgb,format=RGBA,bpp=32,depth=32");
g_object_set (_videoSink, "emit-signals", TRUE,
"caps", videoCaps, // this sets video caps to "video/x-raw-rgb"
"max-buffers", 1, // only one buffer (the last) is maintained in the queue
Expand Down

0 comments on commit 656591d

Please sign in to comment.