• Home
  • Raw
  • Download

Lines Matching refs:interlace

249 GST_ELEMENT_REGISTER_DECLARE (interlace);
253 GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (interlace, "interlace", GST_RANK_NONE,
311 gst_interlace_reset (GstInterlace * interlace) in gst_interlace_reset() argument
313 GST_OBJECT_LOCK (interlace); in gst_interlace_reset()
314 interlace->phase_index = interlace->pattern_offset; in gst_interlace_reset()
315 GST_OBJECT_UNLOCK (interlace); in gst_interlace_reset()
317 interlace->timebase = GST_CLOCK_TIME_NONE; in gst_interlace_reset()
318 interlace->field_index = 0; in gst_interlace_reset()
319 interlace->passthrough = FALSE; in gst_interlace_reset()
320 interlace->switch_fields = FALSE; in gst_interlace_reset()
321 if (interlace->stored_frame) { in gst_interlace_reset()
322 gst_buffer_unref (interlace->stored_frame); in gst_interlace_reset()
323 interlace->stored_frame = NULL; in gst_interlace_reset()
324 interlace->stored_fields = 0; in gst_interlace_reset()
329 gst_interlace_init (GstInterlace * interlace) in gst_interlace_init() argument
332 interlace->sinkpad = in gst_interlace_init()
334 gst_pad_set_chain_function (interlace->sinkpad, gst_interlace_chain); in gst_interlace_init()
335 gst_pad_set_event_function (interlace->sinkpad, gst_interlace_sink_event); in gst_interlace_init()
336 gst_pad_set_query_function (interlace->sinkpad, gst_interlace_sink_query); in gst_interlace_init()
337 gst_element_add_pad (GST_ELEMENT (interlace), interlace->sinkpad); in gst_interlace_init()
339 interlace->srcpad = in gst_interlace_init()
341 gst_pad_set_query_function (interlace->srcpad, gst_interlace_src_query); in gst_interlace_init()
342 gst_element_add_pad (GST_ELEMENT (interlace), interlace->srcpad); in gst_interlace_init()
344 interlace->top_field_first = FALSE; in gst_interlace_init()
345 interlace->allow_rff = FALSE; in gst_interlace_init()
346 interlace->pattern = GST_INTERLACE_PATTERN_2_3; in gst_interlace_init()
347 interlace->new_pattern = GST_INTERLACE_PATTERN_2_3; in gst_interlace_init()
348 interlace->pattern_offset = 0; in gst_interlace_init()
349 interlace->src_fps_n = 0; in gst_interlace_init()
350 interlace->src_fps_d = 1; in gst_interlace_init()
351 gst_interlace_reset (interlace); in gst_interlace_init()
389 gst_interlace_decorate_buffer_ts (GstInterlace * interlace, GstBuffer * buf, in gst_interlace_decorate_buffer_ts() argument
394 GST_OBJECT_LOCK (interlace); in gst_interlace_decorate_buffer_ts()
395 src_fps_n = interlace->src_fps_n; in gst_interlace_decorate_buffer_ts()
396 src_fps_d = interlace->src_fps_d; in gst_interlace_decorate_buffer_ts()
397 GST_OBJECT_UNLOCK (interlace); in gst_interlace_decorate_buffer_ts()
406 GST_BUFFER_DTS (buf) = interlace->timebase + in gst_interlace_decorate_buffer_ts()
408 src_fps_d * interlace->fields_since_timebase, src_fps_n * 2); in gst_interlace_decorate_buffer_ts()
416 gst_interlace_decorate_buffer (GstInterlace * interlace, GstBuffer * buf, in gst_interlace_decorate_buffer() argument
421 GST_OBJECT_LOCK (interlace); in gst_interlace_decorate_buffer()
422 pattern = interlace->pattern; in gst_interlace_decorate_buffer()
423 GST_OBJECT_UNLOCK (interlace); in gst_interlace_decorate_buffer()
425 gst_interlace_decorate_buffer_ts (interlace, buf, n_fields); in gst_interlace_decorate_buffer()
427 if (interlace->field_index == 0) { in gst_interlace_decorate_buffer()
442 interlace_mode_from_pattern (GstInterlace * interlace) in interlace_mode_from_pattern() argument
446 GST_OBJECT_LOCK (interlace); in interlace_mode_from_pattern()
447 pattern = interlace->pattern; in interlace_mode_from_pattern()
448 GST_OBJECT_UNLOCK (interlace); in interlace_mode_from_pattern()
473 gst_interlace_setcaps (GstInterlace * interlace, GstCaps * caps) in gst_interlace_setcaps() argument
487 GST_OBJECT_LOCK (interlace); in gst_interlace_setcaps()
488 interlace->pattern = interlace->new_pattern; in gst_interlace_setcaps()
489 pattern = interlace->pattern; in gst_interlace_setcaps()
490 top_field_first = interlace->top_field_first; in gst_interlace_setcaps()
491 GST_OBJECT_UNLOCK (interlace); in gst_interlace_setcaps()
496 interlace_mode_from_pattern (interlace), NULL); in gst_interlace_setcaps()
512 GST_FIXME_OBJECT (interlace, in gst_interlace_setcaps()
520 src_peer_caps = gst_pad_peer_query_caps (interlace->srcpad, othercaps); in gst_interlace_setcaps()
541 GST_OBJECT_LOCK (interlace); in gst_interlace_setcaps()
542 interlace->phase_index = interlace->pattern_offset; in gst_interlace_setcaps()
543 interlace->src_fps_n = src_fps_n; in gst_interlace_setcaps()
544 interlace->src_fps_d = src_fps_d; in gst_interlace_setcaps()
545 GST_OBJECT_UNLOCK (interlace); in gst_interlace_setcaps()
547 GST_DEBUG_OBJECT (interlace, "new framerate %d/%d", src_fps_n, src_fps_d); in gst_interlace_setcaps()
550 GST_DEBUG_OBJECT (interlace, in gst_interlace_setcaps()
554 interlace->switch_fields = FALSE; in gst_interlace_setcaps()
565 interlace->passthrough = TRUE; in gst_interlace_setcaps()
580 interlace->switch_fields = TRUE; in gst_interlace_setcaps()
584 GST_ERROR_OBJECT (interlace, in gst_interlace_setcaps()
591 GST_ERROR_OBJECT (interlace, in gst_interlace_setcaps()
598 interlace->passthrough = FALSE; in gst_interlace_setcaps()
609 GST_DEBUG_OBJECT (interlace->sinkpad, "set caps %" GST_PTR_FORMAT, caps); in gst_interlace_setcaps()
610 GST_DEBUG_OBJECT (interlace->srcpad, "set caps %" GST_PTR_FORMAT, othercaps); in gst_interlace_setcaps()
612 ret = gst_pad_set_caps (interlace->srcpad, othercaps); in gst_interlace_setcaps()
615 interlace->info = info; in gst_interlace_setcaps()
616 interlace->out_info = out_info; in gst_interlace_setcaps()
622 GST_DEBUG_OBJECT (interlace, "error parsing caps"); in gst_interlace_setcaps()
631 GstInterlace *interlace; in gst_interlace_sink_event() local
633 interlace = GST_INTERLACE (parent); in gst_interlace_sink_event()
637 GST_DEBUG_OBJECT (interlace, "handling FLUSH_START"); in gst_interlace_sink_event()
638 ret = gst_pad_push_event (interlace->srcpad, event); in gst_interlace_sink_event()
641 GST_DEBUG_OBJECT (interlace, "handling FLUSH_STOP"); in gst_interlace_sink_event()
642 gst_interlace_reset (interlace); in gst_interlace_sink_event()
643 ret = gst_pad_push_event (interlace->srcpad, event); in gst_interlace_sink_event()
650 const PulldownFormat *format = &formats[interlace->pattern]; in gst_interlace_sink_event()
653 format->n_fields[interlace->phase_index] - in gst_interlace_sink_event()
654 interlace->stored_fields_pushed; in gst_interlace_sink_event()
655 interlace->stored_fields_pushed = 0; in gst_interlace_sink_event()
662 interlace->stored_frame = in gst_interlace_sink_event()
663 gst_buffer_make_metadata_writable (interlace->stored_frame); in gst_interlace_sink_event()
666 gst_interlace_decorate_buffer (interlace, interlace->stored_frame, in gst_interlace_sink_event()
671 output_buffer = gst_buffer_ref (interlace->stored_frame); in gst_interlace_sink_event()
672 if (gst_pad_push (interlace->srcpad, output_buffer)) { in gst_interlace_sink_event()
673 GST_DEBUG_OBJECT (interlace, "Failed to push buffer %p", in gst_interlace_sink_event()
680 gst_buffer_unref (interlace->stored_frame); in gst_interlace_sink_event()
681 interlace->stored_frame = NULL; in gst_interlace_sink_event()
687 interlace->phase_index++; in gst_interlace_sink_event()
688 if (!format->n_fields[interlace->phase_index]) { in gst_interlace_sink_event()
689 interlace->phase_index = 0; in gst_interlace_sink_event()
694 if (interlace->stored_frame) { in gst_interlace_sink_event()
695 gst_buffer_unref (interlace->stored_frame); in gst_interlace_sink_event()
696 interlace->stored_frame = NULL; in gst_interlace_sink_event()
697 interlace->stored_fields = 0; in gst_interlace_sink_event()
699 ret = gst_pad_push_event (interlace->srcpad, event); in gst_interlace_sink_event()
706 ret = gst_interlace_setcaps (interlace, caps); in gst_interlace_sink_event()
711 ret = gst_pad_push_event (interlace->srcpad, event); in gst_interlace_sink_event()
876 gst_interlace_getcaps (GstPad * pad, GstInterlace * interlace, GstCaps * filter) in gst_interlace_getcaps() argument
888 (pad == interlace->srcpad) ? interlace->sinkpad : interlace->srcpad; in gst_interlace_getcaps()
890 GST_OBJECT_LOCK (interlace); in gst_interlace_getcaps()
891 pattern = interlace->new_pattern; in gst_interlace_getcaps()
892 top_field_first = interlace->top_field_first; in gst_interlace_getcaps()
893 GST_OBJECT_UNLOCK (interlace); in gst_interlace_getcaps()
902 (pad == interlace->sinkpad), TRUE); in gst_interlace_getcaps()
904 GST_FIXME_OBJECT (interlace, in gst_interlace_getcaps()
913 if (pad == interlace->sinkpad) { in gst_interlace_getcaps()
928 if (pattern == GST_INTERLACE_PATTERN_2_2 && pad == interlace->sinkpad) { in gst_interlace_getcaps()
945 if (pad == interlace->srcpad) { in gst_interlace_getcaps()
967 mode = interlace_mode_from_pattern (interlace); in gst_interlace_getcaps()
969 if (pad == interlace->srcpad) { in gst_interlace_getcaps()
1005 if (pad == interlace->sinkpad) { in gst_interlace_getcaps()
1015 GST_FIXME_OBJECT (interlace, in gst_interlace_getcaps()
1036 GstInterlace *interlace; in gst_interlace_sink_query() local
1038 interlace = GST_INTERLACE (parent); in gst_interlace_sink_query()
1046 caps = gst_interlace_getcaps (pad, interlace, filter); in gst_interlace_sink_query()
1063 GstInterlace *interlace; in gst_interlace_src_query() local
1065 interlace = GST_INTERLACE (parent); in gst_interlace_src_query()
1073 caps = gst_interlace_getcaps (pad, interlace, filter); in gst_interlace_src_query()
1087 copy_fields (GstInterlace * interlace, GstBuffer * dest, GstBuffer * src, in copy_fields() argument
1090 GstVideoInfo *in_info = &interlace->info; in copy_fields()
1091 GstVideoInfo *out_info = &interlace->out_info; in copy_fields()
1115 if (!interlace->switch_fields) { in copy_fields()
1137 GST_ERROR_OBJECT (interlace, "failed to map dest"); in copy_fields()
1142 GST_ERROR_OBJECT (interlace, "failed to map src"); in copy_fields()
1149 copy_field (GstInterlace * interlace, GstBuffer * src, int field_index) in copy_field() argument
1156 gst_buffer_new_allocate (NULL, GST_VIDEO_INFO_SIZE (&interlace->out_info), in copy_field()
1159 if (!gst_video_frame_map (&dframe, &interlace->out_info, dest, GST_MAP_WRITE)) in copy_field()
1162 if (!gst_video_frame_map (&sframe, &interlace->info, src, GST_MAP_READ)) in copy_field()
1193 GST_ELEMENT_ERROR (interlace, CORE, FAILED, ("Failed to write map buffer"), in copy_field()
1200 GST_ELEMENT_ERROR (interlace, CORE, FAILED, ("Failed to read map buffer"), in copy_field()
1209 gst_interlace_push_buffer (GstInterlace * interlace, GstBuffer * buffer) in gst_interlace_push_buffer() argument
1211 GST_DEBUG_OBJECT (interlace, "output timestamp %" GST_TIME_FORMAT in gst_interlace_push_buffer()
1223 return gst_pad_push (interlace->srcpad, buffer); in gst_interlace_push_buffer()
1229 GstInterlace *interlace = GST_INTERLACE (parent); in gst_interlace_chain() local
1249 if (interlace->passthrough) { in gst_interlace_chain()
1250 return gst_pad_push (interlace->srcpad, buffer); in gst_interlace_chain()
1253 GST_OBJECT_LOCK (interlace); in gst_interlace_chain()
1254 format = &formats[interlace->pattern]; in gst_interlace_chain()
1255 allow_rff = interlace->allow_rff; in gst_interlace_chain()
1256 pattern_offset = interlace->pattern_offset; in gst_interlace_chain()
1257 top_field_first = interlace->top_field_first; in gst_interlace_chain()
1258 GST_OBJECT_UNLOCK (interlace); in gst_interlace_chain()
1263 if (interlace->stored_frame) { in gst_interlace_chain()
1264 gst_buffer_unref (interlace->stored_frame); in gst_interlace_chain()
1265 interlace->stored_frame = NULL; in gst_interlace_chain()
1266 interlace->stored_fields = 0; in gst_interlace_chain()
1270 interlace->field_index = 0; in gst_interlace_chain()
1272 interlace->field_index = 1; in gst_interlace_chain()
1276 if (interlace->timebase == GST_CLOCK_TIME_NONE) { in gst_interlace_chain()
1278 interlace->timebase = timestamp; in gst_interlace_chain()
1281 if (interlace->stored_fields == 0 in gst_interlace_chain()
1282 && interlace->phase_index == pattern_offset in gst_interlace_chain()
1284 interlace->timebase = timestamp; in gst_interlace_chain()
1285 interlace->fields_since_timebase = 0; in gst_interlace_chain()
1288 current_fields = format->n_fields[interlace->phase_index]; in gst_interlace_chain()
1290 interlace->phase_index++; in gst_interlace_chain()
1291 g_assert (interlace->phase_index < G_N_ELEMENTS (format->n_fields)); in gst_interlace_chain()
1292 if (!format->n_fields[interlace->phase_index]) { in gst_interlace_chain()
1293 interlace->phase_index = 0; in gst_interlace_chain()
1295 if (interlace->switch_fields && !interlace->stored_frame) { in gst_interlace_chain()
1309 GST_VIDEO_INFO_INTERLACE_MODE (&interlace->out_info) == in gst_interlace_chain()
1312 num_fields = interlace->stored_fields + current_fields; in gst_interlace_chain()
1317 GstVideoInfo *in_info = &interlace->info; in gst_interlace_chain()
1318 GstVideoInfo *out_info = &interlace->out_info; in gst_interlace_chain()
1321 num_fields, current_fields, interlace->stored_fields); in gst_interlace_chain()
1323 if (interlace->stored_fields > 0) { in gst_interlace_chain()
1328 output_buffer = copy_field (interlace, interlace->stored_frame, in gst_interlace_chain()
1329 interlace->field_index); in gst_interlace_chain()
1333 output_buffer2 = copy_field (interlace, buffer, in gst_interlace_chain()
1334 interlace->field_index ^ 1); in gst_interlace_chain()
1341 copy_fields (interlace, output_buffer, interlace->stored_frame, in gst_interlace_chain()
1342 interlace->field_index); in gst_interlace_chain()
1344 copy_fields (interlace, output_buffer, buffer, in gst_interlace_chain()
1345 interlace->field_index ^ 1); in gst_interlace_chain()
1348 interlace->stored_fields--; in gst_interlace_chain()
1354 output_buffer = copy_field (interlace, buffer, interlace->field_index); in gst_interlace_chain()
1358 copy_field (interlace, buffer, interlace->field_index ^ 1); in gst_interlace_chain()
1369 GST_ELEMENT_ERROR (interlace, CORE, FAILED, in gst_interlace_chain()
1377 GST_ELEMENT_ERROR (interlace, CORE, FAILED, in gst_interlace_chain()
1406 gst_interlace_decorate_buffer (interlace, output_buffer, n_output_fields, in gst_interlace_chain()
1410 gst_interlace_decorate_buffer_ts (interlace, output_buffer, in gst_interlace_chain()
1419 if (interlace->field_index == 0) { in gst_interlace_chain()
1434 g_assert (interlace->fields_since_timebase <= G_MAXUINT - n_output_fields); in gst_interlace_chain()
1435 interlace->fields_since_timebase += n_output_fields; in gst_interlace_chain()
1436 interlace->field_index ^= (n_output_fields & 1); in gst_interlace_chain()
1438 ret = gst_interlace_push_buffer (interlace, output_buffer); in gst_interlace_chain()
1440 GST_DEBUG_OBJECT (interlace, "Failed to push buffer %p", output_buffer); in gst_interlace_chain()
1445 ret = gst_interlace_push_buffer (interlace, output_buffer2); in gst_interlace_chain()
1447 GST_DEBUG_OBJECT (interlace, "Failed to push buffer %p", in gst_interlace_chain()
1456 if (interlace->stored_frame) { in gst_interlace_chain()
1457 gst_buffer_unref (interlace->stored_frame); in gst_interlace_chain()
1458 interlace->stored_frame = NULL; in gst_interlace_chain()
1459 interlace->stored_fields = 0; in gst_interlace_chain()
1463 interlace->stored_frame = buffer; in gst_interlace_chain()
1464 interlace->stored_fields = current_fields; in gst_interlace_chain()
1475 GstInterlace *interlace = GST_INTERLACE (object); in gst_interlace_set_property() local
1479 GST_OBJECT_LOCK (interlace); in gst_interlace_set_property()
1480 interlace->top_field_first = g_value_get_boolean (value); in gst_interlace_set_property()
1481 GST_OBJECT_UNLOCK (interlace); in gst_interlace_set_property()
1487 GST_OBJECT_LOCK (interlace); in gst_interlace_set_property()
1488 interlace->new_pattern = pattern; in gst_interlace_set_property()
1489 if (interlace->src_fps_n == 0 || interlace->pattern == pattern) in gst_interlace_set_property()
1490 interlace->pattern = pattern; in gst_interlace_set_property()
1493 GST_OBJECT_UNLOCK (interlace); in gst_interlace_set_property()
1496 gst_pad_push_event (interlace->sinkpad, gst_event_new_reconfigure ()); in gst_interlace_set_property()
1500 GST_OBJECT_LOCK (interlace); in gst_interlace_set_property()
1501 interlace->pattern_offset = g_value_get_uint (value); in gst_interlace_set_property()
1502 GST_OBJECT_UNLOCK (interlace); in gst_interlace_set_property()
1505 GST_OBJECT_LOCK (interlace); in gst_interlace_set_property()
1506 interlace->allow_rff = g_value_get_boolean (value); in gst_interlace_set_property()
1507 GST_OBJECT_UNLOCK (interlace); in gst_interlace_set_property()
1519 GstInterlace *interlace = GST_INTERLACE (object); in gst_interlace_get_property() local
1523 GST_OBJECT_LOCK (interlace); in gst_interlace_get_property()
1524 g_value_set_boolean (value, interlace->top_field_first); in gst_interlace_get_property()
1525 GST_OBJECT_UNLOCK (interlace); in gst_interlace_get_property()
1528 GST_OBJECT_LOCK (interlace); in gst_interlace_get_property()
1529 g_value_set_enum (value, interlace->new_pattern); in gst_interlace_get_property()
1530 GST_OBJECT_UNLOCK (interlace); in gst_interlace_get_property()
1533 GST_OBJECT_LOCK (interlace); in gst_interlace_get_property()
1534 g_value_set_uint (value, interlace->pattern_offset); in gst_interlace_get_property()
1535 GST_OBJECT_UNLOCK (interlace); in gst_interlace_get_property()
1538 GST_OBJECT_LOCK (interlace); in gst_interlace_get_property()
1539 g_value_set_boolean (value, interlace->allow_rff); in gst_interlace_get_property()
1540 GST_OBJECT_UNLOCK (interlace); in gst_interlace_get_property()
1551 GstInterlace *interlace = GST_INTERLACE (element); in gst_interlace_change_state() local
1558 GST_OBJECT_LOCK (interlace); in gst_interlace_change_state()
1559 interlace->src_fps_n = 0; in gst_interlace_change_state()
1560 interlace->src_fps_d = 1; in gst_interlace_change_state()
1561 GST_OBJECT_UNLOCK (interlace); in gst_interlace_change_state()
1563 gst_interlace_reset (interlace); in gst_interlace_change_state()
1575 return GST_ELEMENT_REGISTER (interlace, plugin); in plugin_init()
1580 interlace,