Lines Matching refs:src
111 static gboolean read_vts_info (resinDvdSrc * src);
132 static void rsn_dvdsrc_prepare_spu_stream_event (resinDvdSrc * src,
134 static void rsn_dvdsrc_prepare_audio_stream_event (resinDvdSrc * src,
136 static gboolean rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src);
137 static void rsn_dvdsrc_prepare_clut_change_event (resinDvdSrc * src,
139 static void rsn_dvdsrc_update_highlight (resinDvdSrc * src);
141 static void rsn_dvdsrc_enqueue_nav_block (resinDvdSrc * src,
143 static void rsn_dvdsrc_activate_nav_block (resinDvdSrc * src,
145 static void rsn_dvdsrc_clear_nav_blocks (resinDvdSrc * src);
146 static void rsn_dvdsrc_check_nav_blocks (resinDvdSrc * src);
147 static void rsn_dvdsrc_schedule_nav_cb (resinDvdSrc * src,
156 static void rsn_dvdsrc_send_commands_changed (resinDvdSrc * src);
262 resinDvdSrc *src = RESINDVDSRC (object); in rsn_dvdsrc_finalize() local
264 g_mutex_clear (&src->dvd_lock); in rsn_dvdsrc_finalize()
265 g_mutex_clear (&src->branch_lock); in rsn_dvdsrc_finalize()
266 g_cond_clear (&src->still_cond); in rsn_dvdsrc_finalize()
267 g_free (src->device); in rsn_dvdsrc_finalize()
269 gst_buffer_replace (&src->alloc_buf, NULL); in rsn_dvdsrc_finalize()
270 gst_buffer_replace (&src->next_buf, NULL); in rsn_dvdsrc_finalize()
278 resinDvdSrc *src = RESINDVDSRC (bsrc); in rsn_dvdsrc_unlock() local
280 g_mutex_lock (&src->branch_lock); in rsn_dvdsrc_unlock()
281 src->branching = TRUE; in rsn_dvdsrc_unlock()
282 g_cond_broadcast (&src->still_cond); in rsn_dvdsrc_unlock()
283 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_unlock()
291 resinDvdSrc *src = RESINDVDSRC (bsrc); in rsn_dvdsrc_unlock_stop() local
293 g_mutex_lock (&src->branch_lock); in rsn_dvdsrc_unlock_stop()
294 src->branching = FALSE; in rsn_dvdsrc_unlock_stop()
295 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_unlock_stop()
304 resinDvdSrc *src = RESINDVDSRC (object); in rsn_dvdsrc_set_property() local
308 GST_OBJECT_LOCK (src); in rsn_dvdsrc_set_property()
309 g_free (src->device); in rsn_dvdsrc_set_property()
311 src->device = g_strdup (DEFAULT_DEVICE); in rsn_dvdsrc_set_property()
313 src->device = g_value_dup_string (value); in rsn_dvdsrc_set_property()
314 GST_OBJECT_UNLOCK (src); in rsn_dvdsrc_set_property()
317 GST_OBJECT_LOCK (src); in rsn_dvdsrc_set_property()
318 src->faststart = g_value_get_boolean (value); in rsn_dvdsrc_set_property()
319 GST_OBJECT_UNLOCK (src); in rsn_dvdsrc_set_property()
331 resinDvdSrc *src = RESINDVDSRC (object); in rsn_dvdsrc_get_property() local
335 GST_OBJECT_LOCK (src); in rsn_dvdsrc_get_property()
336 g_value_set_string (value, src->device); in rsn_dvdsrc_get_property()
337 GST_OBJECT_UNLOCK (src); in rsn_dvdsrc_get_property()
340 GST_OBJECT_LOCK (src); in rsn_dvdsrc_get_property()
341 g_value_set_boolean (value, src->faststart); in rsn_dvdsrc_get_property()
342 GST_OBJECT_UNLOCK (src); in rsn_dvdsrc_get_property()
353 resinDvdSrc *src = RESINDVDSRC (bsrc); in rsn_dvdsrc_start() local
358 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_start()
359 if (!read_vts_info (src)) { in rsn_dvdsrc_start()
360 GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, in rsn_dvdsrc_start()
365 if (dvdnav_open (&src->dvdnav, src->device) != DVDNAV_STATUS_OK) { in rsn_dvdsrc_start()
366 GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), in rsn_dvdsrc_start()
367 (_("Failed to open DVD device '%s'."), src->device)); in rsn_dvdsrc_start()
371 if (dvdnav_set_PGC_positioning_flag (src->dvdnav, 1) != DVDNAV_STATUS_OK) { in rsn_dvdsrc_start()
372 GST_ELEMENT_ERROR (src, LIBRARY, FAILED, in rsn_dvdsrc_start()
388 dvdnav_menu_language_select (src->dvdnav, lang); in rsn_dvdsrc_start()
389 dvdnav_audio_language_select (src->dvdnav, lang); in rsn_dvdsrc_start()
390 dvdnav_spu_language_select (src->dvdnav, lang); in rsn_dvdsrc_start()
392 if (src->faststart) { in rsn_dvdsrc_start()
393 if (dvdnav_title_play (src->dvdnav, 1) != DVDNAV_STATUS_OK || in rsn_dvdsrc_start()
394 (dvdnav_menu_call (src->dvdnav, DVD_MENU_Title) != DVDNAV_STATUS_OK && in rsn_dvdsrc_start()
395 dvdnav_menu_call (src->dvdnav, in rsn_dvdsrc_start()
398 dvdnav_reset (src->dvdnav); in rsn_dvdsrc_start()
403 g_free (src->disc_name); in rsn_dvdsrc_start()
404 dvdnav_get_title_string (src->dvdnav, &disc_name); in rsn_dvdsrc_start()
406 src->disc_name = gst_tag_freeform_string_to_utf8 (disc_name, -1, NULL); in rsn_dvdsrc_start()
408 src->disc_name = NULL; in rsn_dvdsrc_start()
410 src->first_seek = TRUE; in rsn_dvdsrc_start()
411 src->running = TRUE; in rsn_dvdsrc_start()
412 src->branching = FALSE; in rsn_dvdsrc_start()
413 src->discont = TRUE; in rsn_dvdsrc_start()
414 src->need_segment = TRUE; in rsn_dvdsrc_start()
415 src->need_tag_update = TRUE; in rsn_dvdsrc_start()
417 src->cur_position = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_start()
418 src->pgc_duration = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_start()
419 src->cur_start_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_start()
420 src->cur_end_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_start()
421 src->cur_vobu_base_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_start()
423 src->vts_n = 0; in rsn_dvdsrc_start()
424 src->in_menu = FALSE; in rsn_dvdsrc_start()
425 src->title_n = -1; in rsn_dvdsrc_start()
426 src->part_n = -1; in rsn_dvdsrc_start()
428 src->active_button = -1; in rsn_dvdsrc_start()
429 src->cur_btn_mask = RSN_BTN_NONE; in rsn_dvdsrc_start()
431 src->angles_changed = FALSE; in rsn_dvdsrc_start()
432 src->n_angles = 0; in rsn_dvdsrc_start()
433 src->cur_angle = 0; in rsn_dvdsrc_start()
435 src->commands_changed = TRUE; in rsn_dvdsrc_start()
437 src->cur_spu_phys_stream = -1; in rsn_dvdsrc_start()
438 src->cur_spu_forced_only = FALSE; in rsn_dvdsrc_start()
439 memset (src->cur_clut, 0, sizeof (guint32) * 16); in rsn_dvdsrc_start()
440 src->cur_audio_phys_stream = -1; in rsn_dvdsrc_start()
442 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_start()
447 if (src->dvdnav) { in rsn_dvdsrc_start()
448 dvdnav_close (src->dvdnav); in rsn_dvdsrc_start()
449 src->dvdnav = NULL; in rsn_dvdsrc_start()
451 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_start()
458 read_vts_info (resinDvdSrc * src) in read_vts_info() argument
462 if (src->vts_attrs) { in read_vts_info()
463 g_array_free (src->vts_attrs, TRUE); in read_vts_info()
464 src->vts_attrs = NULL; in read_vts_info()
467 if (src->dvdread) in read_vts_info()
468 DVDClose (src->dvdread); in read_vts_info()
470 src->dvdread = DVDOpen (src->device); in read_vts_info()
471 if (src->dvdread == NULL) in read_vts_info()
474 if (!(src->vmg_file = ifoOpen (src->dvdread, 0))) { in read_vts_info()
478 if (!src->vmg_file->vts_atrt) { in read_vts_info()
480 g_array_set_size (src->vts_attrs, 0); in read_vts_info()
481 src->vts_attrs = NULL; in read_vts_info()
484 n_vts = src->vmg_file->vts_atrt->nr_of_vtss; in read_vts_info()
485 memcpy (&src->vmgm_attr, src->vmg_file->vmgi_mat, sizeof (vmgi_mat_t)); in read_vts_info()
488 src->vts_attrs = in read_vts_info()
490 if (!src->vts_attrs) in read_vts_info()
492 g_array_set_size (src->vts_attrs, n_vts + 1); in read_vts_info()
498 get_vts_attr (resinDvdSrc * src, gint n) in get_vts_attr() argument
502 if (src->vts_attrs == NULL || n >= src->vts_attrs->len) { in get_vts_attr()
503 if (src->vts_attrs) in get_vts_attr()
504 GST_ERROR_OBJECT (src, "No stream info for VTS %d (have %d)", n, in get_vts_attr()
505 src->vts_attrs->len); in get_vts_attr()
507 GST_ERROR_OBJECT (src, "No stream info"); in get_vts_attr()
511 vts_attr = &g_array_index (src->vts_attrs, vtsi_mat_t, src->vts_n); in get_vts_attr()
515 ifo_handle_t *ifo = ifoOpen (src->dvdread, n); in get_vts_attr()
529 memcpy (&g_array_index (src->vts_attrs, vtsi_mat_t, n), in get_vts_attr()
541 resinDvdSrc *src = RESINDVDSRC (bsrc); in rsn_dvdsrc_stop() local
545 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_stop()
547 if (src->nav_clock_id) { in rsn_dvdsrc_stop()
548 gst_clock_id_unschedule (src->nav_clock_id); in rsn_dvdsrc_stop()
549 gst_clock_id_unref (src->nav_clock_id); in rsn_dvdsrc_stop()
550 src->nav_clock_id = NULL; in rsn_dvdsrc_stop()
552 rsn_dvdsrc_clear_nav_blocks (src); in rsn_dvdsrc_stop()
553 src->have_pci = FALSE; in rsn_dvdsrc_stop()
555 if (src->was_mouse_over) { in rsn_dvdsrc_stop()
557 gst_navigation_message_new_mouse_over ((GstObject *) src, FALSE); in rsn_dvdsrc_stop()
558 src->was_mouse_over = FALSE; in rsn_dvdsrc_stop()
562 gst_buffer_replace (&src->alloc_buf, NULL); in rsn_dvdsrc_stop()
563 gst_buffer_replace (&src->next_buf, NULL); in rsn_dvdsrc_stop()
564 src->running = FALSE; in rsn_dvdsrc_stop()
566 if (src->streams_event) { in rsn_dvdsrc_stop()
567 gst_event_unref (src->streams_event); in rsn_dvdsrc_stop()
568 src->streams_event = NULL; in rsn_dvdsrc_stop()
570 if (src->clut_event) { in rsn_dvdsrc_stop()
571 gst_event_unref (src->clut_event); in rsn_dvdsrc_stop()
572 src->clut_event = NULL; in rsn_dvdsrc_stop()
574 if (src->spu_select_event) { in rsn_dvdsrc_stop()
575 gst_event_unref (src->spu_select_event); in rsn_dvdsrc_stop()
576 src->spu_select_event = NULL; in rsn_dvdsrc_stop()
578 if (src->audio_select_event) { in rsn_dvdsrc_stop()
579 gst_event_unref (src->audio_select_event); in rsn_dvdsrc_stop()
580 src->audio_select_event = NULL; in rsn_dvdsrc_stop()
582 if (src->highlight_event) { in rsn_dvdsrc_stop()
583 gst_event_unref (src->highlight_event); in rsn_dvdsrc_stop()
584 src->highlight_event = NULL; in rsn_dvdsrc_stop()
587 g_free (src->disc_name); in rsn_dvdsrc_stop()
588 src->disc_name = NULL; in rsn_dvdsrc_stop()
590 if (src->dvdnav) { in rsn_dvdsrc_stop()
591 if (dvdnav_close (src->dvdnav) != DVDNAV_STATUS_OK) { in rsn_dvdsrc_stop()
592 GST_ELEMENT_ERROR (src, RESOURCE, CLOSE, (NULL), in rsn_dvdsrc_stop()
593 ("dvdnav_close failed: %s", dvdnav_err_to_string (src->dvdnav))); in rsn_dvdsrc_stop()
596 src->dvdnav = NULL; in rsn_dvdsrc_stop()
599 if (src->vmg_file) { in rsn_dvdsrc_stop()
600 ifoClose (src->vmg_file); in rsn_dvdsrc_stop()
601 src->vmg_file = NULL; in rsn_dvdsrc_stop()
603 if (src->vts_file) { in rsn_dvdsrc_stop()
604 ifoClose (src->vts_file); in rsn_dvdsrc_stop()
605 src->vts_file = NULL; in rsn_dvdsrc_stop()
607 if (src->dvdread) { in rsn_dvdsrc_stop()
608 DVDClose (src->dvdread); in rsn_dvdsrc_stop()
609 src->dvdread = NULL; in rsn_dvdsrc_stop()
612 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_stop()
615 gst_element_post_message (GST_ELEMENT_CAST (src), mouse_over_msg); in rsn_dvdsrc_stop()
621 rsn_dvdsrc_do_still (resinDvdSrc * src, int duration) in rsn_dvdsrc_do_still() argument
627 GstSegment *segment = &(GST_BASE_SRC (src)->segment); in rsn_dvdsrc_do_still()
629 if (src->in_still_state == FALSE) { in rsn_dvdsrc_do_still()
630 GST_DEBUG_OBJECT (src, "**** Start STILL FRAME. Duration %d ****", in rsn_dvdsrc_do_still()
634 src->still_time_remaining = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_do_still()
636 src->still_time_remaining = GST_SECOND * duration; in rsn_dvdsrc_do_still()
642 segment->stop = segment->position = src->cur_end_ts; in rsn_dvdsrc_do_still()
643 GST_LOG_OBJECT (src, "Segment position now %" GST_TIME_FORMAT, in rsn_dvdsrc_do_still()
649 hl_event = src->highlight_event; in rsn_dvdsrc_do_still()
650 src->highlight_event = NULL; in rsn_dvdsrc_do_still()
651 cmds_changed = src->commands_changed; in rsn_dvdsrc_do_still()
652 src->commands_changed = FALSE; in rsn_dvdsrc_do_still()
656 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_still()
657 gst_pad_push_event (GST_BASE_SRC_PAD (src), still_event); in rsn_dvdsrc_do_still()
658 gst_pad_push_event (GST_BASE_SRC_PAD (src), seg_event); in rsn_dvdsrc_do_still()
660 GST_LOG_OBJECT (src, "Sending highlight event before still"); in rsn_dvdsrc_do_still()
661 gst_pad_push_event (GST_BASE_SRC_PAD (src), hl_event); in rsn_dvdsrc_do_still()
664 rsn_dvdsrc_send_commands_changed (src); in rsn_dvdsrc_do_still()
666 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_still()
668 g_mutex_lock (&src->branch_lock); in rsn_dvdsrc_do_still()
670 src->in_still_state = TRUE; in rsn_dvdsrc_do_still()
672 GST_DEBUG_OBJECT (src, in rsn_dvdsrc_do_still()
674 GST_TIME_ARGS (src->still_time_remaining)); in rsn_dvdsrc_do_still()
675 g_mutex_lock (&src->branch_lock); in rsn_dvdsrc_do_still()
678 if (src->branching) { in rsn_dvdsrc_do_still()
679 GST_INFO_OBJECT (src, "Branching - aborting still"); in rsn_dvdsrc_do_still()
680 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_do_still()
690 src->need_segment = TRUE; in rsn_dvdsrc_do_still()
692 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_still()
693 GST_LOG_OBJECT (src, "Entering cond_wait still"); in rsn_dvdsrc_do_still()
694 g_cond_wait (&src->still_cond, &src->branch_lock); in rsn_dvdsrc_do_still()
695 GST_LOG_OBJECT (src, "cond_wait still over, branching = %d", in rsn_dvdsrc_do_still()
696 src->branching); in rsn_dvdsrc_do_still()
698 if (src->branching) { in rsn_dvdsrc_do_still()
699 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_do_still()
700 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_still()
703 src->in_still_state = FALSE; in rsn_dvdsrc_do_still()
705 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_do_still()
706 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_still()
710 if (src->still_time_remaining > 0) { in rsn_dvdsrc_do_still()
714 g_get_monotonic_time () + src->still_time_remaining / GST_USECOND; in rsn_dvdsrc_do_still()
718 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_still()
719 GST_LOG_OBJECT (src, "cond_timed_wait still for %d sec", duration); in rsn_dvdsrc_do_still()
721 g_cond_wait_until (&src->still_cond, &src->branch_lock, end_time); in rsn_dvdsrc_do_still()
722 was_signalled |= src->branching; in rsn_dvdsrc_do_still()
724 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_do_still()
725 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_still()
735 src->still_time_remaining = 0; in rsn_dvdsrc_do_still()
737 src->still_time_remaining = remain; in rsn_dvdsrc_do_still()
739 GST_LOG_OBJECT (src, in rsn_dvdsrc_do_still()
742 GST_TIME_ARGS (src->still_time_remaining), src->branching); in rsn_dvdsrc_do_still()
749 GST_DEBUG_OBJECT (src, in rsn_dvdsrc_do_still()
752 if (dvdnav_still_skip (src->dvdnav) != DVDNAV_STATUS_OK) { in rsn_dvdsrc_do_still()
766 GST_LOG_OBJECT (src, "Extended segment position to %" GST_TIME_FORMAT, in rsn_dvdsrc_do_still()
770 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_still()
771 gst_pad_push_event (GST_BASE_SRC_PAD (src), still_event); in rsn_dvdsrc_do_still()
772 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_still()
779 get_current_pgc (resinDvdSrc * src) in get_current_pgc() argument
785 if (dvdnav_is_domain_fp (src->dvdnav)) { in get_current_pgc()
786 return src->vmg_file->first_play_pgc; in get_current_pgc()
789 if (src->vts_n == 0 || src->in_menu) { in get_current_pgc()
794 if (dvdnav_current_title_info (src->dvdnav, &title, &part) != in get_current_pgc()
800 if (title < 1 || title > src->vmg_file->tt_srpt->nr_of_srpts) in get_current_pgc()
804 if (src->vts_n != src->vmg_file->tt_srpt->title[title - 1].title_set_nr) in get_current_pgc()
808 if (src->vts_n == 0) in get_current_pgc()
811 vts_ttn = src->vmg_file->tt_srpt->title[title - 1].vts_ttn; in get_current_pgc()
813 if (vts_ttn < 1 || vts_ttn > src->vts_file->vts_ptt_srpt->nr_of_srpts) in get_current_pgc()
816 if (src->vts_file->vts_ptt_srpt->title[vts_ttn - 1].nr_of_ptts == 0) in get_current_pgc()
819 pgc_n = src->vts_file->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn; in get_current_pgc()
820 if (pgc_n > src->vts_file->vts_pgcit->nr_of_pgci_srp) in get_current_pgc()
823 pgc = src->vts_file->vts_pgcit->pgci_srp[pgc_n - 1].pgc; in get_current_pgc()
829 update_title_info (resinDvdSrc * src, gboolean force) in update_title_info() argument
834 if (dvdnav_get_angle_info (src->dvdnav, &cur_agl, in update_title_info()
835 &n_angles) == DVDNAV_STATUS_OK && src->n_angles != n_angles) { in update_title_info()
837 src->angles_changed = TRUE; in update_title_info()
840 if (dvdnav_current_title_info (src->dvdnav, &title_n, in update_title_info()
842 if (!src->in_menu) in update_title_info()
849 if (title_n != src->title_n || part_n != src->part_n || in update_title_info()
850 src->n_angles != n_angles || src->cur_angle != cur_agl || force) { in update_title_info()
853 src->title_n = title_n; in update_title_info()
854 src->part_n = part_n; in update_title_info()
855 src->n_angles = n_angles; in update_title_info()
856 src->cur_angle = cur_agl; in update_title_info()
872 if (src->disc_name && src->disc_name[0]) { in update_title_info()
876 g_strdup_printf ("%s, %s", title_str, src->disc_name); in update_title_info()
880 title_str = g_strdup (src->disc_name); in update_title_info()
913 rsn_dvdsrc_step (resinDvdSrc * src, gboolean have_dvd_lock) in rsn_dvdsrc_step() argument
921 if (src->alloc_buf == NULL) in rsn_dvdsrc_step()
922 src->alloc_buf = gst_buffer_new_allocate (NULL, DVD_VIDEO_LB_LEN, NULL); in rsn_dvdsrc_step()
924 gst_buffer_map (src->alloc_buf, &mmap, GST_MAP_WRITE); in rsn_dvdsrc_step()
928 dvdnav_ret = dvdnav_get_next_block (src->dvdnav, mmap.data, &event, &len); in rsn_dvdsrc_step()
931 g_mutex_lock (&src->branch_lock); in rsn_dvdsrc_step()
932 if (src->branching) in rsn_dvdsrc_step()
934 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_step()
939 gst_buffer_unmap (src->alloc_buf, &mmap); in rsn_dvdsrc_step()
940 src->next_buf = src->alloc_buf; in rsn_dvdsrc_step()
941 src->alloc_buf = NULL; in rsn_dvdsrc_step()
943 src->next_is_nav_block = FALSE; in rsn_dvdsrc_step()
944 src->next_nav_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_step()
945 src->in_still_state = FALSE; in rsn_dvdsrc_step()
949 pci_t *pci = dvdnav_get_current_nav_pci (src->dvdnav); in rsn_dvdsrc_step()
955 src->in_still_state = FALSE; in rsn_dvdsrc_step()
957 if (new_start_ptm != src->cur_end_ts) { in rsn_dvdsrc_step()
960 GstClockTimeDiff diff = GST_CLOCK_DIFF (src->cur_end_ts, new_start_ptm); in rsn_dvdsrc_step()
961 if (src->cur_end_ts == GST_CLOCK_TIME_NONE || diff > 2 * GST_SECOND || in rsn_dvdsrc_step()
964 GST_DEBUG_OBJECT (src, "Discont NAV packet start TS %" GST_TIME_FORMAT in rsn_dvdsrc_step()
966 GST_TIME_ARGS (new_start_ptm), GST_TIME_ARGS (src->cur_end_ts)); in rsn_dvdsrc_step()
970 GST_LOG_OBJECT (src, "NAV packet start TS %" GST_TIME_FORMAT in rsn_dvdsrc_step()
983 GST_DEBUG_OBJECT (src, in rsn_dvdsrc_step()
986 GST_TIME_ARGS (src->cur_end_ts), in rsn_dvdsrc_step()
988 src->need_segment = TRUE; in rsn_dvdsrc_step()
991 src->cur_start_ts = new_start_ptm; in rsn_dvdsrc_step()
992 src->cur_end_ts = new_end_ptm; in rsn_dvdsrc_step()
993 src->cur_vobu_base_ts = new_base_time; in rsn_dvdsrc_step()
996 gst_buffer_unmap (src->alloc_buf, &mmap); in rsn_dvdsrc_step()
997 src->next_buf = src->alloc_buf; in rsn_dvdsrc_step()
998 src->alloc_buf = NULL; in rsn_dvdsrc_step()
1000 if (!src->have_pci || pci->hli.hl_gi.hli_ss != 2) { in rsn_dvdsrc_step()
1007 src->next_is_nav_block = TRUE; in rsn_dvdsrc_step()
1008 src->next_nav_ts = new_start_ptm; in rsn_dvdsrc_step()
1009 GST_LOG_OBJECT (src, "Storing NAV pack with TS %" GST_TIME_FORMAT, in rsn_dvdsrc_step()
1010 GST_TIME_ARGS (src->next_nav_ts)); in rsn_dvdsrc_step()
1012 src->next_is_nav_block = FALSE; in rsn_dvdsrc_step()
1013 src->next_nav_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_step()
1019 dvdnav_reset (src->dvdnav); in rsn_dvdsrc_step()
1031 if (!rsn_dvdsrc_do_still (src, info->length)) in rsn_dvdsrc_step()
1034 g_mutex_lock (&src->branch_lock); in rsn_dvdsrc_step()
1035 if (src->branching) in rsn_dvdsrc_step()
1037 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_step()
1045 GST_LOG_OBJECT (src, "****** FIXME: WAIT for queues to drain *****"); in rsn_dvdsrc_step()
1047 if (dvdnav_wait_skip (src->dvdnav) != DVDNAV_STATUS_OK) in rsn_dvdsrc_step()
1055 src->pgc_duration = MPEGTIME_TO_GSTTIME (event->pgc_length); in rsn_dvdsrc_step()
1059 src->cur_position = in rsn_dvdsrc_step()
1060 MPEGTIME_TO_GSTTIME (dvdnav_get_current_time (src->dvdnav)); in rsn_dvdsrc_step()
1062 GST_DEBUG_OBJECT (src, in rsn_dvdsrc_step()
1064 GST_TIME_FORMAT, GST_TIME_ARGS (src->pgc_duration), in rsn_dvdsrc_step()
1065 GST_TIME_ARGS (src->cur_position)); in rsn_dvdsrc_step()
1067 message = gst_message_new_duration_changed (GST_OBJECT (src)); in rsn_dvdsrc_step()
1068 gst_element_post_message (GST_ELEMENT (src), message); in rsn_dvdsrc_step()
1070 rsn_dvdsrc_prepare_streamsinfo_event (src); in rsn_dvdsrc_step()
1071 src->need_tag_update = TRUE; in rsn_dvdsrc_step()
1076 rsn_dvdsrc_prepare_clut_change_event (src, (const guint32 *) mmap.data); in rsn_dvdsrc_step()
1082 if (dvdnav_is_domain_vmgm (src->dvdnav)) { in rsn_dvdsrc_step()
1083 src->vts_n = 0; in rsn_dvdsrc_step()
1085 src->vts_n = event->new_vtsN; in rsn_dvdsrc_step()
1086 if (src->vts_file) { in rsn_dvdsrc_step()
1087 ifoClose (src->vts_file); in rsn_dvdsrc_step()
1088 src->vts_file = NULL; in rsn_dvdsrc_step()
1090 src->vts_file = ifoOpen (src->dvdread, src->vts_n); in rsn_dvdsrc_step()
1093 src->in_menu = !dvdnav_is_domain_vts (src->dvdnav); in rsn_dvdsrc_step()
1101 rsn_dvdsrc_prepare_audio_stream_event (src, in rsn_dvdsrc_step()
1103 GST_DEBUG_OBJECT (src, " physical: %d", event->physical); in rsn_dvdsrc_step()
1104 GST_DEBUG_OBJECT (src, " logical: %d", event->logical); in rsn_dvdsrc_step()
1114 rsn_dvdsrc_prepare_spu_stream_event (src, event->logical, phys_track, in rsn_dvdsrc_step()
1117 GST_DEBUG_OBJECT (src, " physical_wide: %x", event->physical_wide); in rsn_dvdsrc_step()
1118 GST_DEBUG_OBJECT (src, " physical_letterbox: %x", in rsn_dvdsrc_step()
1120 GST_DEBUG_OBJECT (src, " physical_pan_scan: %x", in rsn_dvdsrc_step()
1122 GST_DEBUG_OBJECT (src, " logical: %x", event->logical); in rsn_dvdsrc_step()
1126 GST_DEBUG_OBJECT (src, "highlight change event, button %d", in rsn_dvdsrc_step()
1128 rsn_dvdsrc_update_highlight (src); in rsn_dvdsrc_step()
1132 GST_DEBUG_OBJECT (src, "Channel hop - User action"); in rsn_dvdsrc_step()
1133 src->need_segment = TRUE; in rsn_dvdsrc_step()
1138 GST_WARNING_OBJECT (src, "Unknown dvdnav event %d", event); in rsn_dvdsrc_step()
1141 if (src->alloc_buf) { in rsn_dvdsrc_step()
1142 gst_buffer_unmap (src->alloc_buf, &mmap); in rsn_dvdsrc_step()
1145 if (src->highlight_event && have_dvd_lock && src->in_playing) { in rsn_dvdsrc_step()
1146 GstEvent *hl_event = src->highlight_event; in rsn_dvdsrc_step()
1148 src->highlight_event = NULL; in rsn_dvdsrc_step()
1149 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_step()
1150 GST_DEBUG_OBJECT (src, "Sending highlight event - button %d", in rsn_dvdsrc_step()
1151 src->active_button); in rsn_dvdsrc_step()
1152 gst_pad_push_event (GST_BASE_SRC_PAD (src), hl_event); in rsn_dvdsrc_step()
1153 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_step()
1161 gst_buffer_unmap (src->alloc_buf, &mmap); in rsn_dvdsrc_step()
1163 GST_ELEMENT_ERROR (src, RESOURCE, READ, in rsn_dvdsrc_step()
1167 dvdnav_err_to_string (src->dvdnav))); in rsn_dvdsrc_step()
1169 GST_ELEMENT_ERROR (src, RESOURCE, READ, (_("Could not read DVD.")), in rsn_dvdsrc_step()
1171 dvdnav_err_to_string (src->dvdnav))); in rsn_dvdsrc_step()
1177 gst_buffer_unmap (src->alloc_buf, &mmap); in rsn_dvdsrc_step()
1178 GST_ELEMENT_ERROR (src, RESOURCE, READ, (_("Could not read DVD.")), in rsn_dvdsrc_step()
1180 dvdnav_err_to_string (src->dvdnav))); in rsn_dvdsrc_step()
1185 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_step()
1186 gst_buffer_unmap (src->alloc_buf, &mmap); in rsn_dvdsrc_step()
1193 rsn_dvdsrc_send_commands_changed (resinDvdSrc * src) in rsn_dvdsrc_send_commands_changed() argument
1196 gst_navigation_message_new_commands_changed (GST_OBJECT_CAST (src)); in rsn_dvdsrc_send_commands_changed()
1197 gst_element_post_message (GST_ELEMENT_CAST (src), cmds_msg); in rsn_dvdsrc_send_commands_changed()
1201 rsn_dvdsrc_handle_cmds_query (resinDvdSrc * src, GstQuery * query) in rsn_dvdsrc_handle_cmds_query() argument
1216 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_handle_cmds_query()
1219 if (src->n_angles > 1) { in rsn_dvdsrc_handle_cmds_query()
1225 if (src->active_button > 0) { in rsn_dvdsrc_handle_cmds_query()
1230 if (src->cur_btn_mask & RSN_BTN_LEFT) in rsn_dvdsrc_handle_cmds_query()
1232 if (src->cur_btn_mask & RSN_BTN_RIGHT) in rsn_dvdsrc_handle_cmds_query()
1234 if (src->cur_btn_mask & RSN_BTN_UP) in rsn_dvdsrc_handle_cmds_query()
1236 if (src->cur_btn_mask & RSN_BTN_DOWN) in rsn_dvdsrc_handle_cmds_query()
1238 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_handle_cmds_query()
1246 rsn_dvdsrc_handle_angles_query (resinDvdSrc * src, GstQuery * query) in rsn_dvdsrc_handle_angles_query() argument
1251 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_handle_angles_query()
1252 if (dvdnav_get_angle_info (src->dvdnav, &cur_agl, in rsn_dvdsrc_handle_angles_query()
1257 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_handle_angles_query()
1263 rsn_dvdsrc_handle_navigation_query (resinDvdSrc * src, in rsn_dvdsrc_handle_navigation_query() argument
1268 GST_LOG_OBJECT (src, "Have Navigation query of type %d", nq_type); in rsn_dvdsrc_handle_navigation_query()
1272 res = rsn_dvdsrc_handle_cmds_query (src, query); in rsn_dvdsrc_handle_navigation_query()
1275 res = rsn_dvdsrc_handle_angles_query (src, query); in rsn_dvdsrc_handle_navigation_query()
1285 rsn_dvdsrc_prepare_next_block (resinDvdSrc * src, gboolean have_dvd_lock) in rsn_dvdsrc_prepare_next_block() argument
1290 if (src->next_buf) in rsn_dvdsrc_prepare_next_block()
1294 ret = rsn_dvdsrc_step (src, have_dvd_lock); in rsn_dvdsrc_prepare_next_block()
1296 while (ret == GST_FLOW_OK && src->next_buf == NULL); in rsn_dvdsrc_prepare_next_block()
1308 resinDvdSrc *src = RESINDVDSRC (bsrc); in rsn_dvdsrc_create() local
1309 GstSegment *segment = &(GST_BASE_SRC (src)->segment); in rsn_dvdsrc_create()
1322 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_create()
1323 ret = rsn_dvdsrc_prepare_next_block (src, TRUE); in rsn_dvdsrc_create()
1325 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_create()
1329 streams_event = src->streams_event; in rsn_dvdsrc_create()
1330 src->streams_event = NULL; in rsn_dvdsrc_create()
1332 spu_select_event = src->spu_select_event; in rsn_dvdsrc_create()
1333 src->spu_select_event = NULL; in rsn_dvdsrc_create()
1335 audio_select_event = src->audio_select_event; in rsn_dvdsrc_create()
1336 src->audio_select_event = NULL; in rsn_dvdsrc_create()
1338 clut_event = src->clut_event; in rsn_dvdsrc_create()
1339 src->clut_event = NULL; in rsn_dvdsrc_create()
1341 if (src->angles_changed) { in rsn_dvdsrc_create()
1343 if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_create()
1346 gst_navigation_message_new_angles_changed (GST_OBJECT_CAST (src), in rsn_dvdsrc_create()
1349 src->angles_changed = FALSE; in rsn_dvdsrc_create()
1352 cmds_changed = src->commands_changed; in rsn_dvdsrc_create()
1353 src->commands_changed = FALSE; in rsn_dvdsrc_create()
1355 if (src->need_tag_update) { in rsn_dvdsrc_create()
1356 tags = update_title_info (src, FALSE); in rsn_dvdsrc_create()
1357 src->need_tag_update = FALSE; in rsn_dvdsrc_create()
1360 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_create()
1365 GST_LOG_OBJECT (src, "Pushing stream layout event"); in rsn_dvdsrc_create()
1366 gst_pad_push_event (GST_BASE_SRC_PAD (src), streams_event); in rsn_dvdsrc_create()
1369 GST_LOG_OBJECT (src, "Pushing clut event"); in rsn_dvdsrc_create()
1370 gst_pad_push_event (GST_BASE_SRC_PAD (src), clut_event); in rsn_dvdsrc_create()
1374 GST_LOG_OBJECT (src, "Pushing spu_select event"); in rsn_dvdsrc_create()
1375 gst_pad_push_event (GST_BASE_SRC_PAD (src), spu_select_event); in rsn_dvdsrc_create()
1378 GST_LOG_OBJECT (src, "Pushing audio_select event"); in rsn_dvdsrc_create()
1379 gst_pad_push_event (GST_BASE_SRC_PAD (src), audio_select_event); in rsn_dvdsrc_create()
1382 if (src->need_segment) { in rsn_dvdsrc_create()
1386 if (src->cur_position != GST_CLOCK_TIME_NONE) in rsn_dvdsrc_create()
1387 elapsed_time += src->cur_position; in rsn_dvdsrc_create()
1388 if (src->cur_vobu_base_ts != GST_CLOCK_TIME_NONE) in rsn_dvdsrc_create()
1389 elapsed_time += src->cur_vobu_base_ts; in rsn_dvdsrc_create()
1391 GST_DEBUG_OBJECT (src, in rsn_dvdsrc_create()
1394 GST_TIME_ARGS (src->cur_start_ts), GST_TIME_ARGS (src->cur_end_ts), in rsn_dvdsrc_create()
1395 GST_TIME_ARGS (src->cur_vobu_base_ts), GST_TIME_ARGS (elapsed_time)); in rsn_dvdsrc_create()
1397 gst_base_src_new_seamless_segment (GST_BASE_SRC (src), in rsn_dvdsrc_create()
1398 src->cur_start_ts, -1, elapsed_time); in rsn_dvdsrc_create()
1400 src->need_segment = FALSE; in rsn_dvdsrc_create()
1403 if (src->cur_end_ts != GST_CLOCK_TIME_NONE) { in rsn_dvdsrc_create()
1404 segment->position = src->cur_end_ts; in rsn_dvdsrc_create()
1408 GST_LOG_OBJECT (src, "Segment position now %" GST_TIME_FORMAT, in rsn_dvdsrc_create()
1414 gst_pad_push_event (GST_BASE_SRC_PAD (src), tag_event); in rsn_dvdsrc_create()
1417 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_create()
1419 if (src->next_buf != NULL) { in rsn_dvdsrc_create()
1422 if (src->next_is_nav_block) { in rsn_dvdsrc_create()
1423 rsn_dvdsrc_enqueue_nav_block (src, src->next_buf, src->next_nav_ts); in rsn_dvdsrc_create()
1424 src->next_is_nav_block = FALSE; in rsn_dvdsrc_create()
1427 *outbuf = src->next_buf; in rsn_dvdsrc_create()
1428 src->next_buf = NULL; in rsn_dvdsrc_create()
1430 if (src->discont) { in rsn_dvdsrc_create()
1431 GST_LOG_OBJECT (src, "Marking discont buffer"); in rsn_dvdsrc_create()
1433 src->discont = FALSE; in rsn_dvdsrc_create()
1437 if (src->in_playing) { in rsn_dvdsrc_create()
1438 highlight_event = src->highlight_event; in rsn_dvdsrc_create()
1439 src->highlight_event = NULL; in rsn_dvdsrc_create()
1445 rsn_dvdsrc_check_nav_blocks (src); in rsn_dvdsrc_create()
1447 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_create()
1450 GST_LOG_OBJECT (src, "Pushing highlight event with TS %" GST_TIME_FORMAT, in rsn_dvdsrc_create()
1452 gst_pad_push_event (GST_BASE_SRC_PAD (src), highlight_event); in rsn_dvdsrc_create()
1456 gst_element_post_message (GST_ELEMENT_CAST (src), angles_msg); in rsn_dvdsrc_create()
1460 rsn_dvdsrc_send_commands_changed (src); in rsn_dvdsrc_create()
1466 rsn_dvdsrc_perform_button_action (resinDvdSrc * src, in rsn_dvdsrc_perform_button_action() argument
1474 if (!src->have_pci) in rsn_dvdsrc_perform_button_action()
1476 pci = &src->cur_pci; in rsn_dvdsrc_perform_button_action()
1481 dvdnav_get_current_highlight (src->dvdnav, &button); in rsn_dvdsrc_perform_button_action()
1490 if (dvdnav_button_activate (src->dvdnav, pci) == DVDNAV_STATUS_OK) in rsn_dvdsrc_perform_button_action()
1494 if (dvdnav_left_button_select (src->dvdnav, pci) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_perform_button_action()
1503 if (dvdnav_right_button_select (src->dvdnav, pci) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_perform_button_action()
1512 if (dvdnav_lower_button_select (src->dvdnav, pci) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_perform_button_action()
1521 if (dvdnav_upper_button_select (src->dvdnav, pci) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_perform_button_action()
1535 g_cond_broadcast (&src->still_cond); in rsn_dvdsrc_perform_button_action()
1542 rsn_dvdsrc_do_command (resinDvdSrc * src, GstNavigationCommand command) in rsn_dvdsrc_do_command() argument
1548 if (dvdnav_menu_call (src->dvdnav, DVD_MENU_Escape) == DVDNAV_STATUS_OK) in rsn_dvdsrc_do_command()
1552 if (dvdnav_menu_call (src->dvdnav, DVD_MENU_Title) == DVDNAV_STATUS_OK) in rsn_dvdsrc_do_command()
1556 if (dvdnav_menu_call (src->dvdnav, DVD_MENU_Root) == DVDNAV_STATUS_OK) in rsn_dvdsrc_do_command()
1560 if (dvdnav_menu_call (src->dvdnav, DVD_MENU_Subpicture) == in rsn_dvdsrc_do_command()
1565 if (dvdnav_menu_call (src->dvdnav, DVD_MENU_Audio) == DVDNAV_STATUS_OK) in rsn_dvdsrc_do_command()
1569 if (dvdnav_menu_call (src->dvdnav, DVD_MENU_Angle) == DVDNAV_STATUS_OK) in rsn_dvdsrc_do_command()
1573 if (dvdnav_menu_call (src->dvdnav, DVD_MENU_Part) == DVDNAV_STATUS_OK) in rsn_dvdsrc_do_command()
1581 return rsn_dvdsrc_perform_button_action (src, command); in rsn_dvdsrc_do_command()
1586 if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_do_command()
1588 dvdnav_angle_change (src->dvdnav, cur - 1) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_do_command()
1591 dvdnav_angle_change (src->dvdnav, agls) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_do_command()
1596 src->angles_changed = TRUE; in rsn_dvdsrc_do_command()
1597 GST_INFO_OBJECT (src, "Switched to angle %d", new_angle); in rsn_dvdsrc_do_command()
1605 if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_do_command()
1607 && dvdnav_angle_change (src->dvdnav, cur + 1) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_do_command()
1610 && dvdnav_angle_change (src->dvdnav, 1) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_do_command()
1615 src->angles_changed = TRUE; in rsn_dvdsrc_do_command()
1616 GST_INFO_OBJECT (src, "Switched to angle %d", new_angle); in rsn_dvdsrc_do_command()
1629 rsn_dvdsrc_handle_navigation_event (resinDvdSrc * src, GstEvent * event) in rsn_dvdsrc_handle_navigation_event() argument
1646 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1648 if (!src->running) in rsn_dvdsrc_handle_navigation_event()
1652 nav_res = rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_ACTIVATE); in rsn_dvdsrc_handle_navigation_event()
1654 nav_res = rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_LEFT); in rsn_dvdsrc_handle_navigation_event()
1656 nav_res = rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_RIGHT); in rsn_dvdsrc_handle_navigation_event()
1658 nav_res = rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_UP); in rsn_dvdsrc_handle_navigation_event()
1660 nav_res = rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_DOWN); in rsn_dvdsrc_handle_navigation_event()
1662 nav_res = rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_DVD_MENU); in rsn_dvdsrc_handle_navigation_event()
1665 rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_DVD_TITLE_MENU); in rsn_dvdsrc_handle_navigation_event()
1668 rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_DVD_ROOT_MENU); in rsn_dvdsrc_handle_navigation_event()
1673 if (dvdnav_current_title_info (src->dvdnav, &title, &part)) { in rsn_dvdsrc_handle_navigation_event()
1675 dvdnav_prev_pg_search (src->dvdnav); in rsn_dvdsrc_handle_navigation_event()
1680 dvdnav_next_pg_search (src->dvdnav); in rsn_dvdsrc_handle_navigation_event()
1684 rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_PREV_ANGLE); in rsn_dvdsrc_handle_navigation_event()
1687 rsn_dvdsrc_do_command (src, GST_NAVIGATION_COMMAND_NEXT_ANGLE); in rsn_dvdsrc_handle_navigation_event()
1690 GST_INFO_OBJECT (src, "Selecting audio stream %d", new_stream); in rsn_dvdsrc_handle_navigation_event()
1691 rsn_dvdsrc_prepare_audio_stream_event (src, new_stream, new_stream); in rsn_dvdsrc_handle_navigation_event()
1701 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1703 if (!src->running) in rsn_dvdsrc_handle_navigation_event()
1706 if (src->have_pci && in rsn_dvdsrc_handle_navigation_event()
1707 dvdnav_mouse_select (src->dvdnav, &src->cur_pci, (int) x, (int) y) == in rsn_dvdsrc_handle_navigation_event()
1710 if (!src->was_mouse_over) { in rsn_dvdsrc_handle_navigation_event()
1711 GST_DEBUG_OBJECT (src, "Mouse moved onto a button"); in rsn_dvdsrc_handle_navigation_event()
1713 gst_navigation_message_new_mouse_over ((GstObject *) src, TRUE); in rsn_dvdsrc_handle_navigation_event()
1714 src->was_mouse_over = TRUE; in rsn_dvdsrc_handle_navigation_event()
1716 } else if (src->was_mouse_over) { in rsn_dvdsrc_handle_navigation_event()
1717 GST_DEBUG_OBJECT (src, "Mouse moved out of a button"); in rsn_dvdsrc_handle_navigation_event()
1719 gst_navigation_message_new_mouse_over ((GstObject *) src, FALSE); in rsn_dvdsrc_handle_navigation_event()
1720 src->was_mouse_over = FALSE; in rsn_dvdsrc_handle_navigation_event()
1734 GST_DEBUG_OBJECT (src, "Got click at %g, %g", x, y); in rsn_dvdsrc_handle_navigation_event()
1736 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1738 if (!src->running) in rsn_dvdsrc_handle_navigation_event()
1741 if (src->have_pci && dvdnav_mouse_activate (src->dvdnav, &src->cur_pci, in rsn_dvdsrc_handle_navigation_event()
1755 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1757 if (!src->running) in rsn_dvdsrc_handle_navigation_event()
1760 GST_LOG_OBJECT (src, "handling navigation command %d", command); in rsn_dvdsrc_handle_navigation_event()
1761 nav_res = rsn_dvdsrc_do_command (src, command); in rsn_dvdsrc_handle_navigation_event()
1776 src->active_highlight = TRUE; in rsn_dvdsrc_handle_navigation_event()
1780 rsn_dvdsrc_update_highlight (src); in rsn_dvdsrc_handle_navigation_event()
1786 GST_DEBUG_OBJECT (src, "Processing flush and jump"); in rsn_dvdsrc_handle_navigation_event()
1787 g_mutex_lock (&src->branch_lock); in rsn_dvdsrc_handle_navigation_event()
1788 src->branching = TRUE; in rsn_dvdsrc_handle_navigation_event()
1789 g_cond_broadcast (&src->still_cond); in rsn_dvdsrc_handle_navigation_event()
1790 g_mutex_unlock (&src->branch_lock); in rsn_dvdsrc_handle_navigation_event()
1792 hl_event = src->highlight_event; in rsn_dvdsrc_handle_navigation_event()
1793 src->highlight_event = NULL; in rsn_dvdsrc_handle_navigation_event()
1794 src->active_highlight = FALSE; in rsn_dvdsrc_handle_navigation_event()
1796 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1799 GST_DEBUG_OBJECT (src, "Sending highlight change event - button: %d", in rsn_dvdsrc_handle_navigation_event()
1800 src->active_button); in rsn_dvdsrc_handle_navigation_event()
1801 gst_pad_push_event (GST_BASE_SRC_PAD (src), hl_event); in rsn_dvdsrc_handle_navigation_event()
1807 src->flushing_seek = TRUE; in rsn_dvdsrc_handle_navigation_event()
1808 gst_element_send_event (GST_ELEMENT (src), seek); in rsn_dvdsrc_handle_navigation_event()
1810 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1812 rsn_dvdsrc_update_highlight (src); in rsn_dvdsrc_handle_navigation_event()
1815 hl_event = src->highlight_event; in rsn_dvdsrc_handle_navigation_event()
1816 src->highlight_event = NULL; in rsn_dvdsrc_handle_navigation_event()
1818 if (src->angles_changed) { in rsn_dvdsrc_handle_navigation_event()
1820 if (dvdnav_get_angle_info (src->dvdnav, &cur, &agls) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_handle_navigation_event()
1823 gst_navigation_message_new_angles_changed (GST_OBJECT_CAST (src), in rsn_dvdsrc_handle_navigation_event()
1826 src->angles_changed = FALSE; in rsn_dvdsrc_handle_navigation_event()
1828 src->need_tag_update = TRUE; in rsn_dvdsrc_handle_navigation_event()
1831 cmds_changed = src->commands_changed; in rsn_dvdsrc_handle_navigation_event()
1832 src->commands_changed = FALSE; in rsn_dvdsrc_handle_navigation_event()
1834 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1837 GST_DEBUG_OBJECT (src, "Sending highlight change event - button: %d", in rsn_dvdsrc_handle_navigation_event()
1838 src->active_button); in rsn_dvdsrc_handle_navigation_event()
1839 gst_pad_push_event (GST_BASE_SRC_PAD (src), hl_event); in rsn_dvdsrc_handle_navigation_event()
1843 rsn_dvdsrc_send_commands_changed (src); in rsn_dvdsrc_handle_navigation_event()
1847 gst_element_post_message (GST_ELEMENT_CAST (src), mouse_over_msg); in rsn_dvdsrc_handle_navigation_event()
1851 gst_element_post_message (GST_ELEMENT_CAST (src), angles_msg); in rsn_dvdsrc_handle_navigation_event()
1857 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_handle_navigation_event()
1858 GST_DEBUG_OBJECT (src, "Element not started. Ignoring navigation event"); in rsn_dvdsrc_handle_navigation_event()
1863 rsn_dvdsrc_prepare_audio_stream_event (resinDvdSrc * src, guint8 logical_stream, in rsn_dvdsrc_prepare_audio_stream_event() argument
1869 if (phys_stream == src->cur_audio_phys_stream) in rsn_dvdsrc_prepare_audio_stream_event()
1871 src->cur_audio_phys_stream = phys_stream; in rsn_dvdsrc_prepare_audio_stream_event()
1873 GST_DEBUG_OBJECT (src, "Preparing audio change, phys %d", phys_stream); in rsn_dvdsrc_prepare_audio_stream_event()
1882 if (src->audio_select_event) in rsn_dvdsrc_prepare_audio_stream_event()
1883 gst_event_unref (src->audio_select_event); in rsn_dvdsrc_prepare_audio_stream_event()
1884 src->audio_select_event = e; in rsn_dvdsrc_prepare_audio_stream_event()
1888 rsn_dvdsrc_prepare_spu_stream_event (resinDvdSrc * src, guint8 logical_stream, in rsn_dvdsrc_prepare_spu_stream_event() argument
1894 if (phys_stream == src->cur_spu_phys_stream && in rsn_dvdsrc_prepare_spu_stream_event()
1895 forced_only == src->cur_spu_forced_only) { in rsn_dvdsrc_prepare_spu_stream_event()
1898 src->cur_spu_phys_stream = phys_stream; in rsn_dvdsrc_prepare_spu_stream_event()
1899 src->cur_spu_forced_only = forced_only; in rsn_dvdsrc_prepare_spu_stream_event()
1901 GST_DEBUG_OBJECT (src, "Preparing SPU change, log %d phys %d forced %d", in rsn_dvdsrc_prepare_spu_stream_event()
1912 if (src->spu_select_event) in rsn_dvdsrc_prepare_spu_stream_event()
1913 gst_event_unref (src->spu_select_event); in rsn_dvdsrc_prepare_spu_stream_event()
1914 src->spu_select_event = e; in rsn_dvdsrc_prepare_spu_stream_event()
1918 rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src) in rsn_dvdsrc_prepare_streamsinfo_event() argument
1935 if (src->vts_n == 0 || src->vts_attrs == NULL) { in rsn_dvdsrc_prepare_streamsinfo_event()
1938 v_attr = &src->vmgm_attr.vmgm_video_attr; in rsn_dvdsrc_prepare_streamsinfo_event()
1939 a_attrs = &src->vmgm_attr.vmgm_audio_attr; in rsn_dvdsrc_prepare_streamsinfo_event()
1940 n_audio = MIN (1, src->vmgm_attr.nr_of_vmgm_audio_streams); in rsn_dvdsrc_prepare_streamsinfo_event()
1941 s_attrs = &src->vmgm_attr.vmgm_subp_attr; in rsn_dvdsrc_prepare_streamsinfo_event()
1942 n_subp = MIN (1, src->vmgm_attr.nr_of_vmgm_subp_streams); in rsn_dvdsrc_prepare_streamsinfo_event()
1943 } else if (src->in_menu) { in rsn_dvdsrc_prepare_streamsinfo_event()
1945 vts_attr = get_vts_attr (src, src->vts_n); in rsn_dvdsrc_prepare_streamsinfo_event()
1953 vts_attr = get_vts_attr (src, src->vts_n); in rsn_dvdsrc_prepare_streamsinfo_event()
1961 if (src->vts_n > 0 && vts_attr == NULL) in rsn_dvdsrc_prepare_streamsinfo_event()
1964 GST_DEBUG_OBJECT (src, "Preparing streamsinfo for %d audio and " in rsn_dvdsrc_prepare_streamsinfo_event()
1980 cur_audio = dvdnav_get_active_audio_stream (src->dvdnav); in rsn_dvdsrc_prepare_streamsinfo_event()
1985 gint phys_id = dvdnav_get_audio_logical_stream (src->dvdnav, (guint) i); in rsn_dvdsrc_prepare_streamsinfo_event()
1988 GST_DEBUG_OBJECT (src, "No substream ID in map for audio %d. Skipping.", in rsn_dvdsrc_prepare_streamsinfo_event()
1993 GST_DEBUG_OBJECT (src, "mapped logical audio %d to MPEG substream %d", in rsn_dvdsrc_prepare_streamsinfo_event()
1997 src->cur_audio_phys_stream = -1; in rsn_dvdsrc_prepare_streamsinfo_event()
1998 rsn_dvdsrc_prepare_audio_stream_event (src, i, phys_id); in rsn_dvdsrc_prepare_streamsinfo_event()
2003 GST_DEBUG_OBJECT (src, "Ignoring non-A52 stream %d, format %d", i, in rsn_dvdsrc_prepare_streamsinfo_event()
2013 GST_DEBUG_OBJECT (src, "Audio stream %d is format %d, substream %d", i, in rsn_dvdsrc_prepare_streamsinfo_event()
2033 GST_DEBUG_OBJECT (src, "Audio stream %d is language %s", i, lang_code); in rsn_dvdsrc_prepare_streamsinfo_event()
2035 GST_DEBUG_OBJECT (src, "Audio stream %d - no language", i); in rsn_dvdsrc_prepare_streamsinfo_event()
2048 gint phys_id = dvdnav_get_spu_logical_stream (src->dvdnav, (guint) i); in rsn_dvdsrc_prepare_streamsinfo_event()
2051 GST_DEBUG_OBJECT (src, "No substream ID in map for subpicture %d. " in rsn_dvdsrc_prepare_streamsinfo_event()
2057 GST_DEBUG_OBJECT (src, "mapped logical subpicture %d to MPEG substream %d", in rsn_dvdsrc_prepare_streamsinfo_event()
2078 GST_DEBUG_OBJECT (src, "Subpicture stream %d is language %s", i, in rsn_dvdsrc_prepare_streamsinfo_event()
2088 if (src->streams_event) in rsn_dvdsrc_prepare_streamsinfo_event()
2089 gst_event_unref (src->streams_event); in rsn_dvdsrc_prepare_streamsinfo_event()
2090 src->streams_event = e; in rsn_dvdsrc_prepare_streamsinfo_event()
2096 rsn_dvdsrc_prepare_clut_change_event (resinDvdSrc * src, const guint32 * clut) in rsn_dvdsrc_prepare_clut_change_event() argument
2103 if (memcmp (src->cur_clut, clut, sizeof (guint32) * 16) == 0) in rsn_dvdsrc_prepare_clut_change_event()
2105 memcpy (src->cur_clut, clut, sizeof (guint32) * 16); in rsn_dvdsrc_prepare_clut_change_event()
2119 GST_LOG_OBJECT (src, "preparing clut change event %" GST_PTR_FORMAT, event); in rsn_dvdsrc_prepare_clut_change_event()
2121 if (src->clut_event) in rsn_dvdsrc_prepare_clut_change_event()
2122 gst_event_unref (src->clut_event); in rsn_dvdsrc_prepare_clut_change_event()
2123 src->clut_event = event; in rsn_dvdsrc_prepare_clut_change_event()
2131 rsn_dvdsrc_update_highlight (resinDvdSrc * src) in rsn_dvdsrc_update_highlight() argument
2134 pci_t *pci = &src->cur_pci; in rsn_dvdsrc_update_highlight()
2136 int mode = src->active_highlight ? 1 : 0; in rsn_dvdsrc_update_highlight()
2140 if (src->have_pci) { in rsn_dvdsrc_update_highlight()
2141 if (dvdnav_get_current_highlight (src->dvdnav, &button) == DVDNAV_STATUS_OK) { in rsn_dvdsrc_update_highlight()
2142 GST_LOG_OBJECT (src, "current dvdnav button is %d, we have %d", in rsn_dvdsrc_update_highlight()
2143 button, src->active_button); in rsn_dvdsrc_update_highlight()
2151 dvdnav_button_select (src->dvdnav, &src->cur_pci, button); in rsn_dvdsrc_update_highlight()
2162 if (src->active_button != 0) { in rsn_dvdsrc_update_highlight()
2163 src->active_button = 0; in rsn_dvdsrc_update_highlight()
2168 if (src->highlight_event) in rsn_dvdsrc_update_highlight()
2169 gst_event_unref (src->highlight_event); in rsn_dvdsrc_update_highlight()
2170 src->highlight_event = event; in rsn_dvdsrc_update_highlight()
2171 if (src->cur_btn_mask != RSN_BTN_NONE) { in rsn_dvdsrc_update_highlight()
2172 src->cur_btn_mask = RSN_BTN_NONE; in rsn_dvdsrc_update_highlight()
2173 src->commands_changed = TRUE; in rsn_dvdsrc_update_highlight()
2180 if (button != src->active_button || in rsn_dvdsrc_update_highlight()
2181 area.sx != src->area.sx || area.sy != src->area.sy || in rsn_dvdsrc_update_highlight()
2182 area.ex != src->area.ex || area.ey != src->area.ey || in rsn_dvdsrc_update_highlight()
2183 area.palette != src->area.palette) { in rsn_dvdsrc_update_highlight()
2187 GST_DEBUG_OBJECT (src, "Setting highlight. Button %d @ %d,%d,%d,%d " in rsn_dvdsrc_update_highlight()
2191 src->active_button, src->area.sx, src->area.sy, src->area.ex, in rsn_dvdsrc_update_highlight()
2192 src->area.ey, src->area.palette); in rsn_dvdsrc_update_highlight()
2194 memcpy (&(src->area), &area, sizeof (dvdnav_highlight_area_t)); in rsn_dvdsrc_update_highlight()
2207 if (src->active_button < 1) { in rsn_dvdsrc_update_highlight()
2214 src->active_button = button; in rsn_dvdsrc_update_highlight()
2216 if (src->highlight_event) in rsn_dvdsrc_update_highlight()
2217 gst_event_unref (src->highlight_event); in rsn_dvdsrc_update_highlight()
2218 src->highlight_event = event; in rsn_dvdsrc_update_highlight()
2231 if (btn_mask != src->cur_btn_mask) { in rsn_dvdsrc_update_highlight()
2232 src->cur_btn_mask = btn_mask; in rsn_dvdsrc_update_highlight()
2233 src->commands_changed = TRUE; in rsn_dvdsrc_update_highlight()
2239 rsn_dvdsrc_enqueue_nav_block (resinDvdSrc * src, GstBuffer * nav_buf, in rsn_dvdsrc_enqueue_nav_block() argument
2243 GstSegment *seg = &(GST_BASE_SRC (src)->segment); in rsn_dvdsrc_enqueue_nav_block()
2249 if (src->pending_nav_blocks == NULL) { in rsn_dvdsrc_enqueue_nav_block()
2250 src->pending_nav_blocks = src->pending_nav_blocks_end = in rsn_dvdsrc_enqueue_nav_block()
2251 g_slist_append (src->pending_nav_blocks_end, pend_nav); in rsn_dvdsrc_enqueue_nav_block()
2253 src->pending_nav_blocks_end = in rsn_dvdsrc_enqueue_nav_block()
2254 g_slist_append (src->pending_nav_blocks_end, pend_nav); in rsn_dvdsrc_enqueue_nav_block()
2255 src->pending_nav_blocks_end = g_slist_next (src->pending_nav_blocks_end); in rsn_dvdsrc_enqueue_nav_block()
2258 GST_LOG_OBJECT (src, "Enqueued nav with TS %" GST_TIME_FORMAT in rsn_dvdsrc_enqueue_nav_block()
2261 g_slist_length (src->pending_nav_blocks)); in rsn_dvdsrc_enqueue_nav_block()
2265 rsn_dvdsrc_activate_nav_block (resinDvdSrc * src, GstBuffer * nav_buf) in rsn_dvdsrc_activate_nav_block() argument
2273 navRead_PCI (&src->cur_pci, mmap.data + 0x2d); in rsn_dvdsrc_activate_nav_block()
2278 src->have_pci = TRUE; in rsn_dvdsrc_activate_nav_block()
2280 forced_button = src->cur_pci.hli.hl_gi.fosl_btnn & 0x3f; in rsn_dvdsrc_activate_nav_block()
2282 GST_DEBUG_OBJECT (src, "Selecting button %d based on nav packet command", in rsn_dvdsrc_activate_nav_block()
2284 dvdnav_button_select (src->dvdnav, &src->cur_pci, forced_button); in rsn_dvdsrc_activate_nav_block()
2287 rsn_dvdsrc_update_highlight (src); in rsn_dvdsrc_activate_nav_block()
2289 if (src->highlight_event && src->in_still_state) { in rsn_dvdsrc_activate_nav_block()
2290 GST_LOG_OBJECT (src, "Signalling still condition due to highlight change"); in rsn_dvdsrc_activate_nav_block()
2291 g_cond_broadcast (&src->still_cond); in rsn_dvdsrc_activate_nav_block()
2296 rsn_dvdsrc_clear_nav_blocks (resinDvdSrc * src) in rsn_dvdsrc_clear_nav_blocks() argument
2298 GST_DEBUG_OBJECT (src, "Clearing %d pending navpacks", in rsn_dvdsrc_clear_nav_blocks()
2299 g_slist_length (src->pending_nav_blocks)); in rsn_dvdsrc_clear_nav_blocks()
2301 while (src->pending_nav_blocks) { in rsn_dvdsrc_clear_nav_blocks()
2302 RsnDvdPendingNav *cur = (RsnDvdPendingNav *) src->pending_nav_blocks->data; in rsn_dvdsrc_clear_nav_blocks()
2307 src->pending_nav_blocks = in rsn_dvdsrc_clear_nav_blocks()
2308 g_slist_delete_link (src->pending_nav_blocks, src->pending_nav_blocks); in rsn_dvdsrc_clear_nav_blocks()
2311 src->pending_nav_blocks_end = NULL; in rsn_dvdsrc_clear_nav_blocks()
2318 resinDvdSrc *src = (resinDvdSrc *) user_data; in rsn_dvdsrc_nav_clock_cb() local
2319 GstClockTime base_time = gst_element_get_base_time (GST_ELEMENT (src)); in rsn_dvdsrc_nav_clock_cb()
2321 GST_LOG_OBJECT (src, "NAV pack callback for TS %" GST_TIME_FORMAT " at ts %" in rsn_dvdsrc_nav_clock_cb()
2325 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_nav_clock_cb()
2328 if (src->nav_clock_id) { in rsn_dvdsrc_nav_clock_cb()
2329 gst_clock_id_unref (src->nav_clock_id); in rsn_dvdsrc_nav_clock_cb()
2330 src->nav_clock_id = NULL; in rsn_dvdsrc_nav_clock_cb()
2333 while (src->pending_nav_blocks) { in rsn_dvdsrc_nav_clock_cb()
2334 RsnDvdPendingNav *cur = (RsnDvdPendingNav *) src->pending_nav_blocks->data; in rsn_dvdsrc_nav_clock_cb()
2339 GST_DEBUG_OBJECT (src, "Activating nav pack with TS %" GST_TIME_FORMAT in rsn_dvdsrc_nav_clock_cb()
2342 rsn_dvdsrc_activate_nav_block (src, cur->buffer); in rsn_dvdsrc_nav_clock_cb()
2347 src->pending_nav_blocks = in rsn_dvdsrc_nav_clock_cb()
2348 g_slist_delete_link (src->pending_nav_blocks, src->pending_nav_blocks); in rsn_dvdsrc_nav_clock_cb()
2351 if (src->pending_nav_blocks == NULL) in rsn_dvdsrc_nav_clock_cb()
2352 src->pending_nav_blocks_end = NULL; in rsn_dvdsrc_nav_clock_cb()
2356 (RsnDvdPendingNav *) src->pending_nav_blocks->data; in rsn_dvdsrc_nav_clock_cb()
2357 rsn_dvdsrc_schedule_nav_cb (src, next_nav); in rsn_dvdsrc_nav_clock_cb()
2360 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_nav_clock_cb()
2367 rsn_dvdsrc_schedule_nav_cb (resinDvdSrc * src, RsnDvdPendingNav * next_nav) in rsn_dvdsrc_schedule_nav_cb() argument
2372 if (!src->in_playing) { in rsn_dvdsrc_schedule_nav_cb()
2373 GST_LOG_OBJECT (src, "Not scheduling NAV block - state != PLAYING"); in rsn_dvdsrc_schedule_nav_cb()
2377 GST_OBJECT_LOCK (src); in rsn_dvdsrc_schedule_nav_cb()
2378 clock = GST_ELEMENT_CLOCK (src); in rsn_dvdsrc_schedule_nav_cb()
2379 base_ts = GST_ELEMENT (src)->base_time; in rsn_dvdsrc_schedule_nav_cb()
2382 GST_LOG_OBJECT (src, "Not scheduling NAV block - no clock yet"); in rsn_dvdsrc_schedule_nav_cb()
2383 GST_OBJECT_UNLOCK (src); in rsn_dvdsrc_schedule_nav_cb()
2388 src->nav_clock_id = gst_clock_new_single_shot_id (clock, in rsn_dvdsrc_schedule_nav_cb()
2391 GST_OBJECT_UNLOCK (src); in rsn_dvdsrc_schedule_nav_cb()
2393 GST_LOG_OBJECT (src, "Schedule nav pack for running TS %" GST_TIME_FORMAT, in rsn_dvdsrc_schedule_nav_cb()
2396 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_schedule_nav_cb()
2397 gst_clock_id_wait_async (src->nav_clock_id, rsn_dvdsrc_nav_clock_cb, src, in rsn_dvdsrc_schedule_nav_cb()
2400 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_schedule_nav_cb()
2405 rsn_dvdsrc_check_nav_blocks (resinDvdSrc * src) in rsn_dvdsrc_check_nav_blocks() argument
2410 if (src->nav_clock_id != NULL) { in rsn_dvdsrc_check_nav_blocks()
2413 if (src->pending_nav_blocks == NULL) { in rsn_dvdsrc_check_nav_blocks()
2416 if (!src->in_playing) in rsn_dvdsrc_check_nav_blocks()
2419 GST_LOG_OBJECT (src, "Installing NAV callback"); in rsn_dvdsrc_check_nav_blocks()
2420 next_nav = (RsnDvdPendingNav *) src->pending_nav_blocks->data; in rsn_dvdsrc_check_nav_blocks()
2422 rsn_dvdsrc_schedule_nav_cb (src, next_nav); in rsn_dvdsrc_check_nav_blocks()
2428 resinDvdSrc *src = RESINDVDSRC (basesrc); in rsn_dvdsrc_src_event() local
2433 res = rsn_dvdsrc_handle_navigation_event (src, event); in rsn_dvdsrc_src_event()
2438 GST_LOG_OBJECT (src, "handling seek event"); in rsn_dvdsrc_src_event()
2441 src->flushing_seek = ! !(flags & GST_SEEK_FLAG_FLUSH); in rsn_dvdsrc_src_event()
2442 GST_DEBUG_OBJECT (src, "%s seek event", in rsn_dvdsrc_src_event()
2443 src->flushing_seek ? "flushing" : "non-flushing"); in rsn_dvdsrc_src_event()
2449 GST_LOG_OBJECT (src, "handling %s event", GST_EVENT_TYPE_NAME (event)); in rsn_dvdsrc_src_event()
2461 resinDvdSrc *src = RESINDVDSRC (element); in rsn_dvdsrc_post_title_info() local
2468 res = dvdnav_get_number_of_titles (src->dvdnav, &ntitles); in rsn_dvdsrc_post_title_info()
2470 GST_WARNING_OBJECT (src, "Failed to get number of titles: %d", res); in rsn_dvdsrc_post_title_info()
2487 dvdnav_describe_title_chapters (src->dvdnav, n, ×, &duration); in rsn_dvdsrc_post_title_info()
2489 GST_WARNING_OBJECT (src, "Failed to get title %d info", n); in rsn_dvdsrc_post_title_info()
2502 message = gst_message_new_element (GST_OBJECT (src), s); in rsn_dvdsrc_post_title_info()
2503 gst_element_post_message (GST_ELEMENT_CAST (src), message); in rsn_dvdsrc_post_title_info()
2510 resinDvdSrc *src = RESINDVDSRC (element); in rsn_dvdsrc_change_state() local
2516 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_change_state()
2517 src->in_playing = FALSE; in rsn_dvdsrc_change_state()
2518 if (src->nav_clock_id) { in rsn_dvdsrc_change_state()
2519 gst_clock_id_unschedule (src->nav_clock_id); in rsn_dvdsrc_change_state()
2520 gst_clock_id_unref (src->nav_clock_id); in rsn_dvdsrc_change_state()
2521 src->nav_clock_id = NULL; in rsn_dvdsrc_change_state()
2523 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_change_state()
2537 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_change_state()
2538 src->in_playing = TRUE; in rsn_dvdsrc_change_state()
2539 rsn_dvdsrc_check_nav_blocks (src); in rsn_dvdsrc_change_state()
2540 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_change_state()
2555 resinDvdSrc *src = RESINDVDSRC (basesrc); in rsn_dvdsrc_src_query() local
2563 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_src_query()
2564 if (!src->running) { in rsn_dvdsrc_src_query()
2565 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_src_query()
2570 if (src->pgc_duration != GST_CLOCK_TIME_NONE) { in rsn_dvdsrc_src_query()
2571 val = src->pgc_duration; in rsn_dvdsrc_src_query()
2573 GST_DEBUG_OBJECT (src, "duration : %" GST_TIME_FORMAT, in rsn_dvdsrc_src_query()
2581 if (dvdnav_get_number_of_titles (src->dvdnav, in rsn_dvdsrc_src_query()
2590 if (dvdnav_current_title_info (src->dvdnav, &title, in rsn_dvdsrc_src_query()
2592 if (dvdnav_get_number_of_parts (src->dvdnav, title, in rsn_dvdsrc_src_query()
2600 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_src_query()
2605 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_src_query()
2606 if (!src->running) { in rsn_dvdsrc_src_query()
2607 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_src_query()
2613 if (dvdnav_current_title_info (src->dvdnav, &title, in rsn_dvdsrc_src_query()
2622 if (dvdnav_current_title_info (src->dvdnav, &title, in rsn_dvdsrc_src_query()
2629 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_src_query()
2635 res = rsn_dvdsrc_handle_navigation_query (src, nq_type, query); in rsn_dvdsrc_src_query()
2703 rsn_dvdsrc_get_sector_from_time_tmap (resinDvdSrc * src, GstClockTime ts) in rsn_dvdsrc_get_sector_from_time_tmap() argument
2715 if (src->vts_file == NULL) in rsn_dvdsrc_get_sector_from_time_tmap()
2718 if (dvdnav_current_title_info (src->dvdnav, &title, &part) != in rsn_dvdsrc_get_sector_from_time_tmap()
2722 vts_tmapt = src->vts_file->vts_tmapt; in rsn_dvdsrc_get_sector_from_time_tmap()
2728 if (title < 1 || title > src->vmg_file->tt_srpt->nr_of_srpts) in rsn_dvdsrc_get_sector_from_time_tmap()
2732 if (src->vts_n != src->vmg_file->tt_srpt->title[title - 1].title_set_nr) in rsn_dvdsrc_get_sector_from_time_tmap()
2736 if (src->vts_n == 0 || src->in_menu) in rsn_dvdsrc_get_sector_from_time_tmap()
2739 vts_ttn = src->vmg_file->tt_srpt->title[title - 1].vts_ttn; in rsn_dvdsrc_get_sector_from_time_tmap()
2741 GST_DEBUG_OBJECT (src, "Seek to time %" GST_TIME_FORMAT in rsn_dvdsrc_get_sector_from_time_tmap()
2743 GST_TIME_ARGS (ts), src->vts_n, title, vts_ttn, vts_tmapt->nr_of_tmaps); in rsn_dvdsrc_get_sector_from_time_tmap()
2748 pgc = get_current_pgc (src); in rsn_dvdsrc_get_sector_from_time_tmap()
2766 GST_LOG_OBJECT (src, "Got sector %u for time seek (entry %d of %d)", in rsn_dvdsrc_get_sector_from_time_tmap()
2794 GST_DEBUG_OBJECT (src, "Mapped sector %u onto PGC relative sector %u", in rsn_dvdsrc_get_sector_from_time_tmap()
2802 rsn_dvdsrc_seek_to_time (resinDvdSrc * src, GstClockTime ts) in rsn_dvdsrc_seek_to_time() argument
2807 GST_DEBUG_OBJECT (src, "Time seek requested to ts %" GST_TIME_FORMAT, in rsn_dvdsrc_seek_to_time()
2810 sector = rsn_dvdsrc_get_sector_from_time_tmap (src, ts); in rsn_dvdsrc_seek_to_time()
2814 src->discont = TRUE; in rsn_dvdsrc_seek_to_time()
2815 res = dvdnav_sector_search (src->dvdnav, sector, SEEK_SET); in rsn_dvdsrc_seek_to_time()
2826 resinDvdSrc *src = RESINDVDSRC (bsrc); in rsn_dvdsrc_do_seek() local
2829 if (segment->format == rsndvd_format || src->first_seek) { in rsn_dvdsrc_do_seek()
2835 src->first_seek = FALSE; in rsn_dvdsrc_do_seek()
2839 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2840 src->discont = TRUE; in rsn_dvdsrc_do_seek()
2841 ret = rsn_dvdsrc_seek_to_time (src, segment->start); in rsn_dvdsrc_do_seek()
2842 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2846 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2847 if (src->running && in rsn_dvdsrc_do_seek()
2848 dvdnav_get_number_of_titles (src->dvdnav, in rsn_dvdsrc_do_seek()
2851 dvdnav_title_play (src->dvdnav, segment->start); in rsn_dvdsrc_do_seek()
2853 src->discont = TRUE; in rsn_dvdsrc_do_seek()
2856 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2858 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2859 if (src->running) { in rsn_dvdsrc_do_seek()
2861 if (dvdnav_current_title_info (src->dvdnav, &title, &x) == in rsn_dvdsrc_do_seek()
2866 dvdnav_part_play (src->dvdnav, title, 1); in rsn_dvdsrc_do_seek()
2868 dvdnav_prev_pg_search (src->dvdnav); in rsn_dvdsrc_do_seek()
2871 src->discont = TRUE; in rsn_dvdsrc_do_seek()
2873 dvdnav_next_pg_search (src->dvdnav); in rsn_dvdsrc_do_seek()
2875 src->discont = TRUE; in rsn_dvdsrc_do_seek()
2876 } else if (dvdnav_get_number_of_parts (src->dvdnav, title, in rsn_dvdsrc_do_seek()
2879 dvdnav_part_play (src->dvdnav, title, segment->start); in rsn_dvdsrc_do_seek()
2881 src->discont = TRUE; in rsn_dvdsrc_do_seek()
2886 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2892 src->active_button = -1; in rsn_dvdsrc_do_seek()
2894 if (src->flushing_seek) { in rsn_dvdsrc_do_seek()
2896 g_mutex_lock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2897 src->flushing_seek = FALSE; in rsn_dvdsrc_do_seek()
2899 gst_buffer_replace (&src->next_buf, NULL); in rsn_dvdsrc_do_seek()
2900 src->cur_start_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_do_seek()
2901 src->cur_end_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_do_seek()
2902 src->cur_vobu_base_ts = GST_CLOCK_TIME_NONE; in rsn_dvdsrc_do_seek()
2903 src->have_pci = FALSE; in rsn_dvdsrc_do_seek()
2904 if (src->nav_clock_id) { in rsn_dvdsrc_do_seek()
2905 gst_clock_id_unschedule (src->nav_clock_id); in rsn_dvdsrc_do_seek()
2906 gst_clock_id_unref (src->nav_clock_id); in rsn_dvdsrc_do_seek()
2907 src->nav_clock_id = NULL; in rsn_dvdsrc_do_seek()
2909 rsn_dvdsrc_clear_nav_blocks (src); in rsn_dvdsrc_do_seek()
2910 if (src->was_mouse_over) { in rsn_dvdsrc_do_seek()
2912 gst_navigation_message_new_mouse_over ((GstObject *) src, FALSE); in rsn_dvdsrc_do_seek()
2913 src->was_mouse_over = FALSE; in rsn_dvdsrc_do_seek()
2915 g_mutex_unlock (&src->dvd_lock); in rsn_dvdsrc_do_seek()
2918 gst_element_post_message (GST_ELEMENT_CAST (src), mouse_over_msg); in rsn_dvdsrc_do_seek()
2921 GST_LOG_OBJECT (src, "Entering prepare_next_block after seek." in rsn_dvdsrc_do_seek()
2922 " Flushing = %d", src->flushing_seek); in rsn_dvdsrc_do_seek()
2923 while (src->cur_start_ts == GST_CLOCK_TIME_NONE) { in rsn_dvdsrc_do_seek()
2924 if (rsn_dvdsrc_prepare_next_block (src, FALSE) != GST_FLOW_OK) in rsn_dvdsrc_do_seek()
2926 if (src->cur_start_ts == GST_CLOCK_TIME_NONE) in rsn_dvdsrc_do_seek()
2927 gst_buffer_replace (&src->next_buf, NULL); in rsn_dvdsrc_do_seek()
2929 GST_LOG_OBJECT (src, "prepare_next_block after seek done"); in rsn_dvdsrc_do_seek()
2933 segment->position = segment->start = src->cur_start_ts; in rsn_dvdsrc_do_seek()
2934 GST_LOG_OBJECT (src, "Segment position now %" GST_TIME_FORMAT, in rsn_dvdsrc_do_seek()
2939 if (src->cur_position != GST_CLOCK_TIME_NONE) in rsn_dvdsrc_do_seek()
2940 segment->time += src->cur_position; in rsn_dvdsrc_do_seek()
2941 if (src->cur_vobu_base_ts != GST_CLOCK_TIME_NONE) in rsn_dvdsrc_do_seek()
2942 segment->time += src->cur_vobu_base_ts; in rsn_dvdsrc_do_seek()
2947 GST_DEBUG_OBJECT (src, "seek completed. New start TS %" GST_TIME_FORMAT in rsn_dvdsrc_do_seek()
2952 src->need_segment = FALSE; in rsn_dvdsrc_do_seek()
2957 GST_DEBUG_OBJECT (src, "Seek in format %d failed", segment->format); in rsn_dvdsrc_do_seek()