Commit Graph

72 Commits (ac1651c7d3a3c6d7f74ceb5f1aac0bdaddb7fada)

Author SHA1 Message Date
dodgepong 17804ec12f Add latest translations from CrowdIn 2014-10-31 21:02:47 -04:00
fryshorts d9a7b9062d linux-v4l2: Update properties when devices change.
This causes the properties for v4l2 sources to be refreshed when a
device is disconnected/connected.
2014-10-29 10:18:21 -07:00
fryshorts ac40408dfa linux-v4l2: Disable properties when device is not there.
This adds helper function to disable/enable all properties which is
used in the device selected callback to enable/disable the properties
when the selected device is available/unavailable.
2014-10-29 10:18:20 -07:00
fryshorts 3a85d662be linux-v4l2: Always display currently selected device.
This adds some code to the device enumeration that checks if the
currently selected device is present. In case it is not it will
add the device but disable it.
2014-10-29 10:18:20 -07:00
fryshorts 24d1495b84 linux-v4l2: Avoid nested device open/close.
This moves the calls to the property modified functions so the old
handler can close the device. Otherwise this would cause the device
to be opened multiple times.
2014-10-29 10:17:59 -07:00
fryshorts 1945804624 linux-v4l2: Make frame counter local.
This replaces the var in the source struct that was used to print out
the number of captured frames with a local one.
2014-10-29 09:41:34 -07:00
fryshorts 45583a759a linux-v4l2: Make timestamp offset local.
This replaces the var in the source struct that are handling the
timestamp offset with a local one in the capture thread.
This change is mostly to make the code more readable.
2014-10-29 09:41:33 -07:00
fryshorts c0f6733b58 linux-v4l2: Fix select in capture thread.
This moves the enabling/resetting of the file descriptors inside the
capture loop so it is done before each select call. Why this even worked
before is unclear, but doing it the *right* way seems to reduce latency.
2014-10-29 09:41:33 -07:00
jp9000 d6b3230dbc linux-v4l2: Start timestamps from 0 per device
When a new device starts up, make it so that the first timestamp that
occurs starts from 0.  This prevents the internal source timestamp
handling from trying to buffer new frames to the new timestamp value in
case the device changes.
2014-10-23 11:38:59 -07:00
jp9000 40b1cc180d linux-v4l2: Add 'Use System Timing' property
Due to potential driver issues with certain devices, the timestamps are
not always reliable.  This option allows of using the time in which the
frame was received as a timestamp instead.
2014-10-23 11:38:59 -07:00
jp9000 db81c59b5e Revert "Add flag to obs_source_frame for unbuffered video"
This reverts commit c3f4b0f018.

The obs_source_frame should not need to take flags to do this.  This
shouldn't be a setting associated with the frame, but rather a setting
associated with the source itself.  This was the wrong approach to
solving this particular problem.
2014-10-23 10:15:26 -07:00
jp9000 ae0f6b5e3f Revert "linux-v4l2: Add 'unbuffered' property"
This reverts commit cd306d975a.

This removes the 'unbuffered' property for the time being.  There should
be a better way of handling this, such as using system timestamps.
Also, the obs_source_frame::flags member needs to be removed and
replaced with something a bit more ideal.
2014-10-23 10:14:32 -07:00
jp9000 cd306d975a linux-v4l2: Add 'unbuffered' property
This allows the user to select whether to use unbuffered video or not.
Unbuffered video cause the video frames to play back as soon as they're
received, rather than be buffered and attempt to play them back
according to the timestamp value of each frame.
2014-10-22 20:32:47 -07:00
jp9000 c3f4b0f018 Add flag to obs_source_frame for unbuffered video
Add 'flags' member variable to obs_source_frame structure.

The OBS_VIDEO_UNBUFFERED flags causes the video to play back as soon as
it's received (in the next frame playback), causing it to disregard the
timestamp value for the sake of video playback (however, note that the
video timestamp is still used for audio synchronization if audio is
present on the source as well).

This is partly a convenience feature, and partly a necessity for certain
plugins (such as the linux v4l plugin) where timestamp information for
the video frames can sometimes be unreliable.
2014-10-22 20:32:47 -07:00
fryshorts 8a51431fdb Fix left open file descriptor in v4l2 plugin. 2014-10-15 00:13:43 +02:00
fryshorts 9a37b2ce9c Use udev events in the v4l2 plugin.
This adds code to set up the udev monitoring library and use the events
to detect connects/disconnects of devices.
When the currently used device is disconnected the plugin will stop
recording and clean up, so that the device node is freed up.
On reconnection of the device the plugin will use the event to
automatically start the capture again.
2014-10-15 00:13:43 +02:00
fryshorts 1bae57668c Add udev helper library to v4l2 plugin.
This adds a small helper library to the v4l2 plugin that uses udev to
get events for v4l2 devices.
2014-10-15 00:13:43 +02:00
Ben Torell 958b5c12de Latest translations from Crowdin 2014-10-11 18:47:35 -04:00
Palana 94a93abb2b (API Change) Pass data to get_properties when possible 2014-10-01 15:39:57 +02:00
jp9000 c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
Jim 34e2b77c0f Merge pull request #266 from fryshorts/v4l2-input
Fix device capabilities checking and add "Leave unchanged" option for all settings.
2014-09-22 11:53:05 -07:00
fryshorts 0132453d23 Add video format check in v4l2 input.
This adds a check whether the video format from the device is compatible
with obs. This could either happen if the "Leave unchanged" option is
selected for the video format, or if the driver simply overwrites the
requested video format.
2014-09-16 21:54:42 +02:00
fryshorts 91fc59faca Refactor source structure in v4l2 input.
Due to the refactoring of the update function the separation of data
members only to be accessed from inside/outside the capture thread is
no longer needed.
2014-09-16 21:54:42 +02:00
fryshorts 875398e9dd Refactor update function for v4l2 input.
The old implementation of this function assumed that there would be some
settings that could be changed on the fly without restarting the
capture. That was actually never used for any setting.
2014-09-16 20:46:04 +02:00
fryshorts 632642010d Minor refactoring in v4l2 input.
We don't really need to use a dstr here, simply using the
right format specifier for blog will suffice.
2014-09-16 20:35:09 +02:00
fryshorts c3783d055f Add option to leave settings unchanged in v4l2 input.
This adds an additional option for all settings to leave the current
configuration of the device unchanged.
2014-09-16 00:12:45 +02:00
fryshorts dcd395f77e Use helper function to set framerate in v4l2 input. 2014-09-16 00:11:36 +02:00
fryshorts 6c8216c6a6 Use helper function to set format in v4l2 input.
Since the helper function also needs to pack/unpack the resolution, the
pack/unpack functions were moved to the helper library and prefixed with
v4l2_ in order to avoid possible collisions.
2014-09-16 00:11:28 +02:00
fryshorts 8d95a7fb47 Use helper function to set input in v4l2 input. 2014-09-16 00:09:16 +02:00
fryshorts 0abf0f5740 Do not explicitly set a default device in v4l2 input.
This was added at a time where the source properties dialog did not
pop up automatically on source creation. Now when the properties are
displayed the first device in the select input will be selected by
default if there was none already specified by the source settings.

This will make the code cleaner and also save one redundant round of
device enumeration.
2014-09-15 23:27:43 +02:00
fryshorts 841f02be87 Fix device capability checking in v4l2 input.
The capabilities flags that were used previously describe all
capabilities the physical device offers. This would cause devices
that are accessible through multiple device nodes to show up with
all device nodes while only one of the nodes might actually offer
the needed video capture capability.

If the device has more nodes the CAP_DEVICES_CAP flag might be set
in which case the device_caps field is filled with the capabilities
that only apply to that specific node that is opened.
2014-09-15 23:27:43 +02:00
BtbN 9f8b74b720 Add disable options for optional plugins 2014-09-15 19:34:53 +02:00
dodgepong a221fee3d2 Add latest translations from CrowdIn 2014-08-25 14:41:52 -07:00
BtbN 02725acdd4 Fix double invocation of install_obs_plugin in every single plugin 2014-08-19 14:24:59 +02:00
fryshorts cd6d2eb9b6 Fix crash in v4l2 plugin.
This adds checks to make sure munmap and bfree are only called
when there was actually memory mapped and allocated.
2014-08-11 23:35:43 +02:00
fryshorts d73d2b22f8 Fix infinite loop in v4l2 plugin.
When initialization of the device fails the plugin may hang
trying to join a non-existing pthread.
2014-08-11 23:35:43 +02:00
fryshorts 71200051b0 Move some functions to separate file for v4l2 plugin.
This moves some functions that are generic to a separate source
file. While doing so the api to those functions was improved to
be more generic and not depend on knowledge about the internal
structure of the plugin.
2014-08-11 23:35:43 +02:00
fryshorts 7e4972e747 Small cleanups in v4l2 plugin. 2014-08-11 23:35:43 +02:00
fryshorts 07d4c5f037 Make device inputs selectable for v4l2 plugin.
This adds an additional property to the plugin to select
an input if the device has multiple ones.
2014-08-11 23:35:43 +02:00
fryshorts 3031cb4b4c Minor code refactoring in v4l2 plugin. 2014-08-11 23:00:57 +02:00
jp9000 04712b5fe9 (API Change) Unsquish obs_data_* names
Changed:                 To:
-----------------------------------------------
obs_data_getjson         obs_data_get_json
obs_data_getstring       obs_data_get_string
obs_data_getint          obs_data_get_int
obs_data_getdouble       obs_data_get_double
obs_data_getbool         obs_data_get_bool
obs_data_getobj          obs_data_get_obj
obs_data_getarray        obs_data_get_array
obs_data_setstring       obs_data_set_string
obs_data_setint          obs_data_set_int
obs_data_setdouble       obs_data_set_double
obs_data_setbool         obs_data_set_bool
obs_data_setobj          obs_data_set_obj
obs_data_setarray        obs_data_set_array
obs_data_item_getstring  obs_data_item_get_string
obs_data_item_getint     obs_data_item_get_int
obs_data_item_getdouble  obs_data_item_get_double
obs_data_item_getbool    obs_data_item_get_bool
obs_data_item_getobj     obs_data_item_get_obj
obs_data_item_getarray   obs_data_item_get_array
obs_data_item_setstring  obs_data_item_set_string
obs_data_item_setint     obs_data_item_set_int
obs_data_item_setdouble  obs_data_item_set_double
obs_data_item_setbool    obs_data_item_set_bool
obs_data_item_setobj     obs_data_item_set_obj
obs_data_item_setarray   obs_data_item_set_array
2014-08-09 11:57:36 -07:00
jp9000 2d606dd8d8 (API Change) Use 'get' convention: API callbacks
Renamed:                       To:
-------------------------------------------------------
obs_source_info::defaults       obs_source_info::get_defaults
obs_source_info::properties     obs_source_info::get_properties
obs_output_info::defaults       obs_output_info::get_defaults
obs_output_info::properties     obs_output_info::get_properties
obs_output_info::total_bytes    obs_output_info::get_total_bytes
obs_output_info::dropped_frames obs_output_info::get_dropped_frames
obs_encoder_info::defaults      obs_encoder_info::get_defaults
obs_encoder_info::properties    obs_encoder_info::get_properties
obs_encoder_info::extra_data    obs_encoder_info::get_extra_data
obs_encoder_info::sei_data      obs_encoder_info::get_sei_data
obs_encoder_info::audio_info    obs_encoder_info::get_audio_info
obs_encoder_info::video_info    obs_encoder_info::get_video_fino
obs_service_info::defaults      obs_service_info::get_defaults
obs_service_info::properties    obs_service_info::get_properties
2014-08-09 11:57:30 -07:00
jp9000 c83d05117f (API Change) Unsquish libobs API callback names
Renamed:                    To:
-------------------------------------------------------
obs_source_info::getname    obs_source_info::get_name
obs_source_info::getwidth   obs_source_info::get_width
obs_source_info::getheight  obs_source_info::get_height
obs_output_info::getname    obs_output_info::get_name
obs_encoder_info::getname   obs_encoder_info::get_name
obs_service_info::getname   obs_service_info::get_name
2014-08-08 11:04:46 -07:00
jp9000 4122a5b9b5 (API Change) Rename 'source_frame' + related
For the sake of naming consistency with the rest of obs.h, prefix this
structure and associated functions with obs_.

Renamed structures:
- struct source_frame (now obs_source_frame)

Renamed functions:
- source_frame_init (now obs_source_frame_init)
- source_frame_free (now obs_source_frame_free)
- source_frame_create (now obs_source_frame_create)
- source_frame_destroy (now obs_source_frame_destroy)

Affected functions:
- obs_source_output_video
- obs_source_get_frame
- obs_source_release_frame
2014-08-08 11:04:42 -07:00
Jim eecc9ab937 Merge pull request #202 from fryshorts/v4l2-input
Add libv4l2 as dependency for the v4l2 plugin
2014-07-29 11:39:43 -07:00
jp9000 892fdea83e Remove macro to free locale
This functionality can now be handled automatically because locale can
now be freed seaparately from obs_module_unload with
obs_module_free_locale, which is called automatically when the module is
being freed.
2014-07-27 17:29:10 -07:00
jp9000 f0ac19abba Remove version parameter from obs_module_load
Replaced by obs_get_version() API
2014-07-27 17:29:10 -07:00
fryshorts 273c244eff Improved Documentation and Logging for mmap functions in v4l2 plugin.
This adds some documentation to the mmap functions and also
improves the logging by bumping errors to LOG_ERROR.
2014-07-26 19:55:57 +02:00
fryshorts 276a97877b Add const keyword to fixed lists in v4l2 plugin.
This should save a little bit of memory memory.
2014-07-26 19:29:08 +02:00
fryshorts 25f71fd71d Improved Documentation and Logging for update in v4l2 plugin.
This adds some documentation to the update function and also
improves the logging by adding some info and bumping errors
to LOG_ERROR.
2014-07-26 19:29:08 +02:00