summaryrefslogtreecommitdiffstats
path: root/mp_core.h
Commit message (Collapse)AuthorAgeFilesLines
* core: move most mpcommon.c contents to mplayer.cUoti Urpala2011-01-151-0/+2
| | | | | | | | | | | | | | | | The contents of mpcommon.c were quite arbitrary; the most common reason to place some functions in this file had been "MEncoder happens to need similar code as MPlayer and we want to share some parts, but we have no clue whatsoever how to organize things in a sensible way, so we'll just dump those parts we want to share in mpcommon.c". As a result of containing an essentially random subset of top-level player functionality the mpcommon.h header required access to central structs and was unsuitable for inclusion in lower-level code, but was nonetheless included there for the mplayer_version symbol. Move almost all contents from mpcommon.c to mplayer.c. mplayer.c is already big and should perhaps be split further, but keeping a few random functions in mpcommon.c would not be an improvement.
* core: move global "subdata" and "vo_sub_last" to mpctxUoti Urpala2011-01-111-0/+3
|
* Merge branch 'hr-seek'Uoti Urpala2010-12-201-2/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hr-seek: input: add default keybindings Shift+[arrow] for small exact seeks input: support bindings with modifier keys for X input core: audio: make ogg missing audio timing workaround more complex core: add support for precise non-keyframe-limited seeks core: add struct for queued seek info commands: add generic option -> property wrapper options: add "choice" option type, use for -pts-association-mode core: remove looping in update_video(), modify command handling a bit core: seek: use accurate seek mode with audio-only files core: avoid using sh_video->pts as "current pts" libvo: register X11 connection fd in input event system core: timing: add special handling of long frame intervals core: move central play loop to a separate function Conflicts: DOCS/tech/slave.txt
| * core: add support for precise non-keyframe-limited seeksUoti Urpala2010-12-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for seeking to an arbitrary non-keyframe position by decoding video starting from the previous keyframe. Whether to use this functionality when seeking is controlled by the new option -hr-seek and a new third argument to the "seek" command. The default is to use it for absolute seeks (like chapter seeks) but not for relative ones. Because there's currently no support for cutting encoded audio some desync is expected if encoded audio passthrough is used. Currently precise seeks always go to the first frame with timestamp equal to or greater than the target position; there's no support for "matching or earlier" backwards seeks at frame level.
| * core: add struct for queued seek infoUoti Urpala2010-12-201-2/+11
| | | | | | | | | | | | | | | | To prepare for the addition of exact seek support, add a struct for queued seek state and a helper function to update its state. It would have been cumbersome to update additional state (showing whether the seek is forced to be exact or non-exact) manually at every point that handles seeks.
| * core: remove looping in update_video(), modify command handling a bitUoti Urpala2010-12-161-0/+3
| | | | | | | | | | | | | | | | | | Let higher-level code call update_video() again instead of looping inside it until there's a frame ready to show. Change the conditions for running user commands somewhat. Overall effect shouldn't be that big. Now other commands can be executed after a seek before a video frame is decoded; in this case the seek target time may be used as the "current position".
| * core: avoid using sh_video->pts as "current pts"Uoti Urpala2010-12-141-0/+3
| | | | | | | | | | | | Add a new field "video_pts" to mpctx. It records the time of the last frame flipped visible on VO. Change various code which used sh_video->pts to use either the new field or get_current_time(mpctx).
* | core: avoid using build_afilter_chain() directlyreimar2010-12-161-1/+0
|/ | | | | | | | | | build_afilter_chain is not safe to use directly, thus make it static and instead use reinit_audio_chain which should have better error handling. Fixes a crash with -af hrtf and changing speed, audio will still stop playing though. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32648 b3059339-0415-0410-9bf9-f77b7e298cf2
* core: do initial A-V sync by modifying audio streamUoti Urpala2010-11-131-0/+4
| | | | | | | Add code to enforce matching pts with video when (re)starting the audio stream, by either cutting away the first samples or inserting silence at the beginning. New option -noinitial-audio-sync can be used to disable this and return to old behavior.
* core: rename update_video_immediately->restart_playbackUoti Urpala2010-11-111-3/+3
|
* core: move video pos/length query functions from demux to coreUoti Urpala2010-11-081-0/+3
| | | | | | | | | Move functions to query current playback position, percentage position and total video length from from the demuxer layer to top level. The functions need access to playback state that doesn't belong on the demuxing level. Make the new functions more capable and simplify some code that can now rely on them. This fixes some errors in displayed in OSD and slave mode information when using timeline (ordered chapters).
* subs: Change global subtitle numbering schemereimar2010-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change numbering so that demuxers can "asynchronously" add subtitles during playback. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31678 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix calculation of global_sub_size. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31711 b3059339-0415-0410-9bf9-f77b7e298cf2 Update global_sub_pos if we auto-selected a subtitle. This avoid strange behaviour with subtitle selection in that case, because the subtitle selection code thinks no subtitle was displayed while we actually did display one. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31863 b3059339-0415-0410-9bf9-f77b7e298cf2 Move function to avoid a forward declaration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31864 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix subtitle selection: make selecting -sid 0 work again by replacing the M_PROPERTY_STEP_UP hack by M_PROPERTY_SET and set the global sub pos also when we do not yet have a subtitle stream but do know the number of subs from out-of-band as e.g. for DVD. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31882 b3059339-0415-0410-9bf9-f77b7e298cf2 100l, re-add vobsub_get_id_by_index call accidentally removed in r31678. Patch by ubitux [ubitux gmail com]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31985 b3059339-0415-0410-9bf9-f77b7e298cf2
* core: track current chapter for relative chapter seeksUoti Urpala2010-04-251-0/+6
| | | | | | | | | | Due to inexact seeks, chapter seek commands may result in a playback position that's inside the previous chapter. This causes problems when the user does repeated next-chapter/previous-chapter seeks, because the code will use the wrong base for calculating 'next' or 'previous'. Improve the behavior by adding a heuristic that keeps track of what chapter the user last wanted to seek to and adjusts the "current chapter" value based on that.
* Merge svn change r30560Uoti Urpala2010-03-091-3/+3
|\
| * Rename exit_reason_t enum to exit_reason and do not typedef it.diego2010-02-141-4/+4
| | | | | | | | | | | | | | The _t namespace is reserved for POSIX; the typedef is pointless obfuscation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30560 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Fix exit_player() usage throughout the codebase.diego2010-02-141-0/+1
| | | | | | | | | | | | | | | | | | | | exit_player() was declared with differing parameter types in mplayer.c and mplayer.h. Make the declaration in the .h file match the one in the .c file and adjust all usages of exit_player() throughout the codebase. Also move the exit_player() declaration into mp_core.h next to exit_player_with_rc(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30558 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+18
|\|
| * Add license header to all top-level files missing them.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
| * At startup and while seeking avoid to introduce pointless sleeps and possiblyreimar2010-01-041-0/+2
| | | | | | | | | | | | | | desync due to codec delay. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30218 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Also reset time_frame and next_frame_time on reset, it makes no sense toreimar2010-01-041-0/+3
| | | | | | | | | | | | | | | | process the sleep before playing the frame seeked to and can be annoying when the user tries to escape a series of "stuck" frames with a huge duration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30217 b3059339-0415-0410-9bf9-f77b7e298cf2
* | core/VO: Allow VO drivers to add/modify framesUoti Urpala2009-09-181-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add interfaces to allow VO drivers to add or remove frames from the video stream and to alter timestamps. Currently this functionality only works with in correct-pts mode. Use the new functionality in vo_vdpau to properly support frame-adding deinterlace modes. Frames added by the VDPAU deinterlacing code are now properly timed. Before every second frame was always shown immediately (probably next monitor refresh) after the previous one, even if you were watching things in slow motion, and framestepping didn't stop at them at all. When seeking the deinterlace algorithm is no longer fed a mix of frames from old and new positions. As a side effect of the changes a problem with resize events was also fixed. Resizing calls video_to_output_surface() to render the frame at the new resolution, but before this function also changed the list of history frames, so resizing could give an image different from the original one, and also corrupt next frames due to them seeing the wrong history. Now the function has no such side effects. There are more resize-related problems though that will be fixed in a later commit. The deint_mpi[] list of reserved frames is increased from 2 to 3 entries for reasons related to the above. Having 2 entries is enough when you initially get a new frame in draw_image() because then you'll have those two entries plus the new one for a total of 3 (the code relied on the oldest mpi implicitly staying reserved for the duration of the call even after usage count was decreased). However if you want to be able to reproduce the rendering outside draw_image(), relying on the explicitly reserved list only, then it needs to store 3 entries.
* | Change libass type names to match upstream renamesUoti Urpala2009-07-291-1/+1
| |
* | Remove the internal GUIAnton Khirnov2009-07-071-1/+1
| | | | | | | | | | | | | | | | | | The GUI is badly designed and too closely coupled to the internal details of other code. The GUI code is in bad shape and unmaintained for years. There is no indication that anyone would maintain it in the future either. Even if someone did volunteer to implement a better integrated GUI having the current code in the tree probably wouldn't help much. So get rid of it.
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-1/+1
| |
* | Support chapter seeking with ordered chaptersUoti Urpala2009-04-021-1/+12
| |
* | Initial ordered chapters supportUoti Urpala2009-04-021-0/+18
| | | | | | | | | | | | | | | | | | | | | | Add basic support for Matroska ordered chapters. The switching between segments is implemented as a general edit timeline that could also be used for other purposes. Some things still need improvement. In particular the current code does not try to do any proper mapping between audio/video/subtitle streams of different files and there should be options for better control of how MPlayer searches other files for the required content.
* | core: Clean up OSD seek info logicUoti Urpala2009-03-311-1/+6
| | | | | | | | | | | | | | | | | | | | Clean up the code and make the behavior more consistent. Before bits of the OSD information were triggered in different places, and various property commands that affect playback position only showed the seek bar while the main seek command also triggered showing the percentage in OSD text. Now only the seek and chapter commands trigger all information and others nothing (which is consistent with most property behavior).
* | core: Rewrite some of the A/V sync related codeUoti Urpala2009-01-141-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable functionality changes: * Timing change between any two frames is now accurately limited to 1/10 of their nominal distance. Previous code did not always use the correct duration. * The status line now keeps showing the same A-V sync value from one video frame change to the next. Previously it kept recalculating the value using a new audio position but the same video position when the status line was updated between video frames. This incorrectly showed the video losing sync with audio. * The status line now displays actual measured A-V difference in autosync mode too. The previous code displayed values that completely ignored real timing in autosync mode, showing 0 A-V difference even when video was significantly behind audio due to inadequate decoding speed. The new behavior can make the shown A-V values appear more unstable if the audio out has unreliable delay measurements (the most likely reason to use autosync), but this is a display change rather than a timing quality change. * Autosync mode now tries to adjust timing by the amount of time vo_flip() calls take, so the calls start earlier and finish at the time the frame should be shown. Previously non-autosync mode adjusted for this but autosync did not. * The warning about the system being too slow to decode the video in realtime is now displayed in autosync mode too.
* | Update OSD while pausedUoti Urpala2008-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | When OSD contents change while paused, try to change the OSD drawn in the currently visible frame. If such OSD updates are not supported then advance by one frame and draw the OSD normally. Add some support for OSD redrawing to vo xv. The new xv code makes a copy of the original frame contents before drawing the OSD if MPlayer is already paused when the frame is drawn. If such a copy of the current frame exists then the frame contents can be restored and a different OSD drawn on top of the same frame.
* | Start pause handling changesUoti Urpala2008-12-091-1/+7
| | | | | | | | | | | | | | Add separate pause_player() / unpause_player functions(), move some pausing-related state into explicit variables and make commands while paused not unpause. Not everything works properly while paused yet (no screen updates etc).
* | Merge svn changes up to r28087Uoti Urpala2008-12-041-1/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: command.c libao2/ao_ivtv.c libao2/ao_v4l2.c libmpcodecs/dec_video.h libvo/aspect.h libvo/sub.c libvo/sub.h libvo/vo_directx.c libvo/vo_macosx.m libvo/vo_quartz.c mp_core.h mplayer.c mplayer.h osdep/getch2.h osdep/timer.h
| * Print ID_EXIT and exit reason message in identify mode when exiting.reimar2008-12-021-1/+7
| | | | | | | | | | | | | | Patch by rvm [rvm3000 ya com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28066 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Change a bunch of video/audio-output-specific preprocessor directives fromdiego2008-08-031-1/+1
| | | | | | | | | | | | | | a HAVE_ prefix to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27402 b3059339-0415-0410-9bf9-f77b7e298cf2
* | core: Clean up move-to-next-file logicUoti Urpala2008-08-131-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mpctx->eof field was used to also store other reasons to stop playing the current file besides EOF, and the code didn't properly distinguish those from EOF. Rename the field to "stop_play" and clean up some of the code accessing it. Properly separating EOF from other reasons allows handling file switching better. Before this commit buffered audio was always drained before moving to the next file (the only exception when it was NOT drained when stopping a file was when quitting the player completely). This added an extra delay when manually moving to the next file as you had to wait for the currently buffered audio to finish playing before the next file would start. After this commit audio is only drained if the file reaches EOF normally; otherwise audio is cut and the next file starts immediately.
* | Merge svn changes up to r27374Uoti Urpala2008-07-301-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h cfg-mplayer.h command.c configure libmpcodecs/dec_video.c libmpcodecs/vd.c libmpcodecs/vf_vo.c libmpdemux/demuxer.h libmpdemux/stheader.h mp_core.h mplayer.c stream/stream_radio.c
| * Start unifying names of internal preprocessor directives.diego2008-07-301-2/+2
| | | | | | | | | | | | | | | | Replace all USE_ prefixes by CONFIG_ prefixes to indicate options which are configurable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Create a context struct for OSD stateUoti Urpala2008-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit creates the struct and passes it to some functions that needs to access OSD state but does not yet move much data from globals to it. vf_expand accesses the OSD state for rendering purposes outside of the normal OSD draw time. The way this currently works is suboptimal, but I did not attempt to clean it up now. To keep things working the same way vf_expand needs to know the address of the state object to be able to access the data even in the functions that should normally not need it. For that purpose this commit adds a VFCTRL to tell vf_expand the address of the object.
* | Merge svn changes up to r26979Uoti Urpala2008-06-041-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the conflicts are trivial. Conflicts: Makefile cfg-mplayer.h input/input.c libmenu/vf_menu.c libmpcodecs/dec_video.c libmpcodecs/vf_expand.c libmpcodecs/vf_vo.c libmpdemux/demux_mkv.c libmpdemux/demuxer.c libmpdemux/demuxer.h libvo/vo_directfb2.c libvo/vo_gl.c libvo/vo_winvidix.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c libvo/x11_common.c mplayer.c osdep/timer-linux.c stream/cache2.c
| * Add a slave command to stop stream playback.ben2008-05-271-0/+1
| | | | | | | | | | | | | | | | | | Mostly useful when used with -idle mode. Patch by Mathieu Schroeter ( mathieu dot schroeter at gamesover dot ch ) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26909 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove INITIALIZED_INPUT from mpctx->initialized_flagsUoti Urpala2008-04-301-1/+0
| | | | | | | | | | The input functions are never uninited except at exit. Move the uninit to player exit function and remove the flag.
* | Create a context for input.c stateUoti Urpala2008-04-301-0/+1
| | | | | | | | | | | | | | |