本文整理汇总了C++中GST_VIDEO_INFO_HEIGHT函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_VIDEO_INFO_HEIGHT函数的具体用法?C++ GST_VIDEO_INFO_HEIGHT怎么用?C++ GST_VIDEO_INFO_HEIGHT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_VIDEO_INFO_HEIGHT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gst_gl_transformation_filter_texture
static gboolean
gst_gl_transformation_filter_texture (GstGLFilter * filter, guint in_tex,
guint out_tex)
{
GstGLTransformation *transformation = GST_GL_TRANSFORMATION (filter);
transformation->in_tex = in_tex;
/* blocking call, use a FBO */
gst_gl_context_use_fbo_v2 (filter->context,
GST_VIDEO_INFO_WIDTH (&filter->out_info),
GST_VIDEO_INFO_HEIGHT (&filter->out_info),
filter->fbo, filter->depthbuffer,
out_tex, gst_gl_transformation_callback, (gpointer) transformation);
return TRUE;
}
示例2: gst_rsvg_dec_set_format
static gboolean
gst_rsvg_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
{
GstRsvgDec *rsvg = GST_RSVG_DEC (decoder);
GstVideoInfo *info = &state->info;
if (rsvg->input_state)
gst_video_codec_state_unref (rsvg->input_state);
rsvg->input_state = gst_video_codec_state_ref (state);
/* Create the output state */
gst_video_decoder_set_output_state (decoder, GST_RSVG_VIDEO_FORMAT,
GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info),
rsvg->input_state);
return TRUE;
}
示例3: lock
PassRefPtr<BitmapTexture> MediaPlayerPrivateGStreamerBase::updateTexture(TextureMapper* textureMapper)
{
GMutexLocker<GMutex> lock(m_sampleMutex);
if (!m_sample)
return nullptr;
GstCaps* caps = gst_sample_get_caps(m_sample);
if (!caps)
return nullptr;
GstVideoInfo videoInfo;
gst_video_info_init(&videoInfo);
if (!gst_video_info_from_caps(&videoInfo, caps))
return nullptr;
IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
RefPtr<BitmapTexture> texture = textureMapper->acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
GstBuffer* buffer = gst_sample_get_buffer(m_sample);
#if GST_CHECK_VERSION(1, 1, 0)
GstVideoGLTextureUploadMeta* meta;
if ((meta = gst_buffer_get_video_gl_texture_upload_meta(buffer))) {
if (meta->n_textures == 1) { // BRGx & BGRA formats use only one texture.
const BitmapTextureGL* textureGL = static_cast<const BitmapTextureGL*>(texture.get());
guint ids[4] = { textureGL->id(), 0, 0, 0 };
if (gst_video_gl_texture_upload_meta_upload(meta, ids))
return texture;
}
}
#endif
// Right now the TextureMapper only supports chromas with one plane
ASSERT(GST_VIDEO_INFO_N_PLANES(&videoInfo) == 1);
GstVideoFrame videoFrame;
if (!gst_video_frame_map(&videoFrame, &videoInfo, buffer, GST_MAP_READ))
return nullptr;
int stride = GST_VIDEO_FRAME_PLANE_STRIDE(&videoFrame, 0);
const void* srcData = GST_VIDEO_FRAME_PLANE_DATA(&videoFrame, 0);
texture->updateContents(srcData, WebCore::IntRect(WebCore::IntPoint(0, 0), size), WebCore::IntPoint(0, 0), stride, BitmapTexture::UpdateCannotModifyOriginalImageData);
gst_video_frame_unmap(&videoFrame);
return texture;
}
示例4: gst_gaussianblur_set_info
static gboolean
gst_gaussianblur_set_info (GstVideoFilter * filter, GstCaps * incaps,
GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
{
GstGaussianBlur *gb = GST_GAUSSIANBLUR (filter);
guint32 n_elems;
gb->width = GST_VIDEO_INFO_WIDTH (in_info);
gb->height = GST_VIDEO_INFO_HEIGHT (in_info);
/* get stride */
gb->stride = GST_VIDEO_INFO_COMP_STRIDE (in_info, 0);
n_elems = gb->stride * gb->height;
gb->tempim = g_malloc (sizeof (gfloat) * n_elems);
return TRUE;
}
示例5: gst_glimage_sink_on_resize
static void
gst_glimage_sink_on_resize (const GstGLImageSink * gl_sink, gint width,
gint height)
{
/* Here gl_sink members (ex:gl_sink->info) have a life time of set_caps.
* It means that they cannot not change between two set_caps
*/
const GstGLFuncs *gl = gl_sink->context->gl_vtable;
GST_TRACE ("GL Window resized to %ux%u", width, height);
/* check if a client reshape callback is registered */
if (gl_sink->clientReshapeCallback)
gl_sink->clientReshapeCallback (width, height, gl_sink->client_data);
/* default reshape */
else {
if (gl_sink->keep_aspect_ratio) {
GstVideoRectangle src, dst, result;
src.x = 0;
src.y = 0;
src.w = GST_VIDEO_INFO_WIDTH (&gl_sink->info);
src.h = GST_VIDEO_INFO_HEIGHT (&gl_sink->info);
dst.x = 0;
dst.y = 0;
dst.w = width;
dst.h = height;
gst_video_sink_center_rect (src, dst, &result, TRUE);
gl->Viewport (result.x, result.y, result.w, result.h);
} else {
gl->Viewport (0, 0, width, height);
}
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (gl_sink->context)) {
gl->MatrixMode (GL_PROJECTION);
gl->LoadIdentity ();
gluOrtho2D (0, width, 0, height);
gl->MatrixMode (GL_MODELVIEW);
}
#endif
}
}
开发者ID:freedesktop-unofficial-mirror,项目名称:gstreamer__attic__gst-plugins-gl,代码行数:45,代码来源:gstglimagesink.c
示例6: gst_ffmpegscale_get_unit_size
static gboolean
gst_ffmpegscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
gsize * size)
{
GstVideoInfo info;
if (!gst_video_info_from_caps (&info, caps))
return FALSE;
*size = info.size;
GST_DEBUG_OBJECT (trans,
"unit size = %" G_GSIZE_FORMAT " for format %d w %d height %d", *size,
GST_VIDEO_INFO_FORMAT (&info), GST_VIDEO_INFO_WIDTH (&info),
GST_VIDEO_INFO_HEIGHT (&info));
return TRUE;
}
示例7: gst_imx_compositor_negotiated_caps
static gboolean gst_imx_compositor_negotiated_caps(GstImxBPVideoAggregator *videoaggregator, GstCaps *caps)
{
GstVideoInfo info;
GstImxCompositor *compositor = GST_IMX_COMPOSITOR(videoaggregator);
/* Output caps have been negotiated. Set up a suitable DMA buffer pool
* (cleaning up any old buffer pool first) and inform subclass about
* the new output caps. */
if (!gst_video_info_from_caps(&info, caps))
{
GST_ERROR_OBJECT(compositor, "could not get video info from negotiated caps");
return FALSE;
}
/* Get the new overall width/height from video info */
compositor->overall_width = GST_VIDEO_INFO_WIDTH(&info);
compositor->overall_height = GST_VIDEO_INFO_HEIGHT(&info);
GST_DEBUG_OBJECT(videoaggregator, "negotiated width/height: %u/%u", compositor->overall_width, compositor->overall_height);
/* Update the overall region based on the new overall width/height */
gst_imx_compositor_update_overall_region(compositor);
/* Cleanup old buffer pool */
if (compositor->dma_bufferpool != NULL)
gst_object_unref(GST_OBJECT(compositor->dma_bufferpool));
/* And get the new one */
compositor->dma_bufferpool = gst_imx_compositor_create_bufferpool(compositor, caps, 0, 0, 0, NULL, NULL);
if (compositor->dma_bufferpool != NULL)
{
GstImxCompositorClass *klass = GST_IMX_COMPOSITOR_CLASS(G_OBJECT_GET_CLASS(compositor));
/* Inform subclass about the new output video info */
if (klass->set_output_video_info != NULL)
return klass->set_output_video_info(compositor, &info);
else
return TRUE;
}
else
return FALSE;
}
示例8: gst_gl_effects_init_gl_resources
/* init resources that need a gl context */
static void
gst_gl_effects_init_gl_resources (GstGLFilter * filter)
{
GstGLEffects *effects = GST_GL_EFFECTS (filter);
gint i;
for (i = 0; i < NEEDED_TEXTURES; i++) {
glGenTextures (1, &effects->midtexture[i]);
glBindTexture (GL_TEXTURE_2D, effects->midtexture[i]);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8,
GST_VIDEO_INFO_WIDTH (&filter->out_info),
GST_VIDEO_INFO_HEIGHT (&filter->out_info),
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
}
开发者ID:freedesktop-unofficial-mirror,项目名称:gstreamer__attic__gst-plugins-gl,代码行数:20,代码来源:gstgleffects.c
示例9: xvimage_buffer_pool_alloc
/* This function handles GstXImageBuffer creation depending on XShm availability */
static GstFlowReturn
xvimage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
GstBufferPoolAcquireParams * params)
{
GstXvImageBufferPool *xvpool = GST_XVIMAGE_BUFFER_POOL_CAST (pool);
GstVideoInfo *info;
GstBuffer *xvimage;
GstMemory *mem;
GError *err = NULL;
info = &xvpool->info;
xvimage = gst_buffer_new ();
mem = gst_xvimage_allocator_alloc (xvpool->allocator, xvpool->im_format,
info, xvpool->padded_width, xvpool->padded_height, &xvpool->crop, &err);
if (mem == NULL) {
gst_buffer_unref (xvimage);
goto no_buffer;
}
gst_buffer_append_memory (xvimage, mem);
if (xvpool->add_metavideo) {
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
gst_buffer_add_video_meta_full (xvimage, GST_VIDEO_FRAME_FLAG_NONE,
GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info),
info->offset, info->stride);
}
*buffer = xvimage;
return GST_FLOW_OK;
/* ERROR */
no_buffer:
{
GST_WARNING_OBJECT (pool, "can't create image: %s", err->message);
g_clear_error (&err);
return GST_FLOW_ERROR;
}
}
示例10: gst_jpeg_dec_negotiate
static void
gst_jpeg_dec_negotiate (GstJpegDec * dec, gint width, gint height, gint clrspc)
{
GstVideoCodecState *outstate;
GstVideoInfo *info;
GstVideoFormat format;
switch (clrspc) {
case JCS_RGB:
format = GST_VIDEO_FORMAT_RGB;
break;
case JCS_GRAYSCALE:
format = GST_VIDEO_FORMAT_GRAY8;
break;
default:
format = GST_VIDEO_FORMAT_I420;
break;
}
/* Compare to currently configured output state */
outstate = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (dec));
if (outstate) {
info = &outstate->info;
if (width == GST_VIDEO_INFO_WIDTH (info) &&
height == GST_VIDEO_INFO_HEIGHT (info) &&
format == GST_VIDEO_INFO_FORMAT (info)) {
gst_video_codec_state_unref (outstate);
return;
}
gst_video_codec_state_unref (outstate);
}
outstate =
gst_video_decoder_set_output_state (GST_VIDEO_DECODER (dec), format,
width, height, dec->input_state);
gst_video_codec_state_unref (outstate);
GST_DEBUG_OBJECT (dec, "max_v_samp_factor=%d", dec->cinfo.max_v_samp_factor);
GST_DEBUG_OBJECT (dec, "max_h_samp_factor=%d", dec->cinfo.max_h_samp_factor);
}
示例11: _update_caps
static GstCaps *
_update_caps (GstVideoAggregator * vagg, GstCaps * caps)
{
GList *l;
gint best_width = -1, best_height = -1;
GstVideoInfo info;
GstCaps *ret = NULL;
gst_video_info_from_caps (&info, caps);
GST_OBJECT_LOCK (vagg);
for (l = GST_ELEMENT (vagg)->sinkpads; l; l = l->next) {
GstVideoAggregatorPad *vaggpad = l->data;
GstCompositorPad *compositor_pad = GST_COMPOSITOR_PAD (vaggpad);
gint this_width, this_height;
gint width, height;
width = GST_VIDEO_INFO_WIDTH (&vaggpad->info);
height = GST_VIDEO_INFO_HEIGHT (&vaggpad->info);
if (width == 0 || height == 0)
continue;
this_width = width + MAX (compositor_pad->xpos, 0);
this_height = height + MAX (compositor_pad->ypos, 0);
if (best_width < this_width)
best_width = this_width;
if (best_height < this_height)
best_height = this_height;
}
GST_OBJECT_UNLOCK (vagg);
if (best_width > 0 && best_height > 0) {
info.width = best_width;
info.height = best_height;
if (set_functions (GST_COMPOSITOR (vagg), &info))
ret = gst_video_info_to_caps (&info);
}
return ret;
}
示例12: is_surface_resolution_changed
static gboolean
is_surface_resolution_changed (GstVideoDecoder *vdec, GstVaapiSurface *surface)
{
guint surface_width, surface_height;
guint configured_width, configured_height;
GstVideoCodecState *state;
gboolean ret = FALSE;
gst_vaapi_surface_get_size(surface, &surface_width, &surface_height);
state = gst_video_decoder_get_output_state (vdec);
configured_width = GST_VIDEO_INFO_WIDTH (&state->info);
configured_height = GST_VIDEO_INFO_HEIGHT (&state->info);
gst_video_codec_state_unref (state);
if (surface_width != configured_width || surface_height != configured_height)
ret = TRUE;
return ret;
}
示例13: gst_gdk_pixbuf_sink_set_caps
static gboolean
gst_gdk_pixbuf_sink_set_caps (GstBaseSink * basesink, GstCaps * caps)
{
GstGdkPixbufSink *sink = GST_GDK_PIXBUF_SINK (basesink);
GstVideoInfo info;
GstVideoFormat fmt;
gint w, h, s, par_n, par_d;
GST_LOG_OBJECT (sink, "caps: %" GST_PTR_FORMAT, caps);
if (!gst_video_info_from_caps (&info, caps)) {
GST_WARNING_OBJECT (sink, "parse_caps failed");
return FALSE;
}
fmt = GST_VIDEO_INFO_FORMAT (&info);
w = GST_VIDEO_INFO_WIDTH (&info);
h = GST_VIDEO_INFO_HEIGHT (&info);
s = GST_VIDEO_INFO_COMP_PSTRIDE (&info, 0);
par_n = GST_VIDEO_INFO_PAR_N (&info);
par_d = GST_VIDEO_INFO_PAR_N (&info);
g_assert ((fmt == GST_VIDEO_FORMAT_RGB && s == 3) ||
(fmt == GST_VIDEO_FORMAT_RGBA && s == 4));
GST_VIDEO_SINK_WIDTH (sink) = w;
GST_VIDEO_SINK_HEIGHT (sink) = h;
sink->par_n = par_n;
sink->par_d = par_d;
sink->has_alpha = GST_VIDEO_INFO_HAS_ALPHA (&info);
GST_INFO_OBJECT (sink, "format : %d", fmt);
GST_INFO_OBJECT (sink, "width x height : %d x %d", w, h);
GST_INFO_OBJECT (sink, "pixel-aspect-ratio : %d/%d", par_n, par_d);
sink->info = info;
return TRUE;
}
示例14: gst_wayland_buffer_pool_set_config
static gboolean
gst_wayland_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
{
GstWaylandBufferPool *self = GST_WAYLAND_BUFFER_POOL_CAST (pool);
GstCaps *caps;
if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL))
goto wrong_config;
if (caps == NULL)
goto no_caps;
/* now parse the caps from the config */
if (!gst_video_info_from_caps (&self->info, caps))
goto wrong_caps;
GST_LOG_OBJECT (pool, "%dx%d, caps %" GST_PTR_FORMAT,
GST_VIDEO_INFO_WIDTH (&self->info), GST_VIDEO_INFO_HEIGHT (&self->info),
caps);
/*Fixme: Enable metadata checking handling based on the config of pool */
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
/* ERRORS */
wrong_config:
{
GST_WARNING_OBJECT (pool, "invalid config");
return FALSE;
}
no_caps:
{
GST_WARNING_OBJECT (pool, "no caps in config");
return FALSE;
}
wrong_caps:
{
GST_WARNING_OBJECT (pool,
"failed getting geometry from caps %" GST_PTR_FORMAT, caps);
return FALSE;
}
}
示例15: gst_opencv_parse_iplimage_params_from_caps
gboolean
gst_opencv_parse_iplimage_params_from_caps (GstCaps * caps, gint * width,
gint * height, gint * ipldepth, gint * channels, GError ** err)
{
GstVideoInfo info;
gint i, depth = 0;
if (!gst_video_info_from_caps (&info, caps)) {
GST_ERROR ("Failed to get the videoinfo from caps");
g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_NEGOTIATION,
"No width/heighti/depth/channels in caps");
return FALSE;
}
*width = GST_VIDEO_INFO_WIDTH (&info);
*height = GST_VIDEO_INFO_HEIGHT (&info);
if (GST_VIDEO_INFO_IS_RGB (&info))
*channels = 3;
else if (GST_VIDEO_INFO_IS_GRAY (&info))
*channels = 1;
else {
g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_NEGOTIATION,
"Unsupported caps %s", gst_caps_to_string(caps));
return FALSE;
}
for (i = 0; i < GST_VIDEO_INFO_N_COMPONENTS (&info); i++)
depth += GST_VIDEO_INFO_COMP_DEPTH (&info, i);
if (depth / *channels == 8) {
/* TODO signdness? */
*ipldepth = IPL_DEPTH_8U;
} else if (depth / *channels == 16) {
*ipldepth = IPL_DEPTH_16U;
} else {
g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_NEGOTIATION,
"Unsupported depth/channels %d/%d", depth, *channels);
return FALSE;
}
return TRUE;
}