Commit Graph

104 Commits (6f68d9eb9793c3db3a89ed419c5133082b596be2)

Author SHA1 Message Date
dodgepong d0fbe3b382 Add latest translations from CrowdIn 2015-05-08 17:10:39 -04:00
fryshorts 4bdb45a8ac linux-v4l2: Add include directory to cmake
Add the include directories found by cmake to the v4l2 plugin.
This allows for the plugin to compile when the vl42 headers were
found in a directory that is not normally in the search path of the
compiler (e.g. /usr/local/include)
2015-05-04 22:37:17 +02:00
Kris Moore cef95722f9 linux-v4l2: Fix device enumeration on FreeBSD
Add platform specific code to enumerate v4l2 devices on FreeBSD.
2015-05-04 22:37:17 +02:00
fryshorts 4497ab31c2 linux-v4l2: Fix build errors for older api
Fix build errors for older versions of the api where
VIDIOC_ENUM_DV_TIMINGS was defined but V4L2_IN_CAP_DV_TIMINGS was not.
I was under the impression that they were added at the same time, but
apparently i was wrong there.

Thanks to kmoore@FreeBSD.org for spotting this on FreeBSD.
2015-05-02 15:05:38 +02:00
fryshorts 4bf7a7b61e linux-v4l2: Replace custom udev callbacks
Use the signal system provided by obs instead of the custom callback
implementation. This reduces the amount of code and complexity.
2015-04-23 21:50:36 +02:00
fryshorts 34c3be43d1 linux-v4l2: Fix build when missing ENUM_DV_TIMINGS
Add compatibility with older versions of the api by not failing to
build when the VIDIOC_ENUM_DV_TIMINGS is missing. In older versions
of the api there was a different system to get dv-timing presets, which
was replaced by the current enumeration system with Linux 3.4.
This will allow for the plugin to be built against older versions of the
api by disabling the enumeration support, thus reducing the
functionality for some devices.
2015-04-22 20:09:18 +02:00
fryshorts 85518e7cca linux-v4l2: Fix build when missing CAP_DEVICE_CAPS
Improve compatibility with older versions of the api by not requiring
V4L2_CAP_DEVICE_CAPS. If we don't have this, we fall back to using the
capabilities member for the whole device instead of the device_caps
member for the currently selected subdevice. Just like we would do if
the device would not support this.
The new device_caps field was introduced with Linux 3.3.
2015-04-22 20:07:35 +02:00
fryshorts 161552beb8 linux-v4l2: Fix compile error for missing formats
Add ifdefs around the video format definitions in order to allow for
compilation with older kernel headers that don't yet have those defined.
2015-04-20 20:53:30 +02:00
fryshorts 3f4174a8c0 linux-v4l2: Add additional video formats
Add BGRX and BGRA as supported video formats, since obs can handle them
directly. I unfortunately missed those when i initially wrote this
mapping due to my webcam not offering those formats.
2015-04-20 20:09:14 +02:00
fryshorts 9734c6a49d linux-v4l2: Fix documentation
Change argument name in documentation to match the code.
2015-04-08 23:02:58 +02:00
fryshorts 707047a31e linux-v4l2: Fix documentation
Remove argument in documentation that does not exist in the code.
2015-04-08 23:02:58 +02:00
dodgepong a04548070c UI: Add latest translations from CrowdIn 2015-03-25 20:51:25 -04:00
fryshorts cdbf193e2e linux-v4l2: Add buffering option
Add a source property to enable buffering of frames, which is enabled by
default. This replaces the old "Use system timing" option by setting the
unbuffered source flag instead of using different timestamps.
While similar in intentions to the old option, this method should reduce
latency even more.
2015-03-04 21:21:22 +01:00
fryshorts c0f47c7efd linux-v4l2: Remove the system timing option
Remove the system timing property and code-path.
2015-03-04 21:01:18 +01:00
fryshorts 6b95b2ccf7 linux-v4l2: Improve logging of pixel format
Use the macro from the mac capture plugin to convert the fourcc integer
value to a string. This makes the debug statement for the pixel format
slightly more readable for the casual developer.
2015-03-01 18:53:51 +01:00
fryshorts 7905197b7c linux-v4l2: Remove "Leave Unchanged" option
Remove the "Leave Unchanged" option for the input and video format
select.

This option was primarily added for cases in which the
resolution and framerate are set by another program or the capture
device itself and the values are not directly supported by the plugin.
One major usecase here would be capture devices for tv signals which
might be set to a spcific resolution and refresh rate, and might fail
to initialize in case any other combination of those settings is forced.

In case of the input this option did not make much sense, as the first
input is probably the best default option in most cases.

For the video format this default is even bad in some cases. If an
format emulated by libv4l2 is selected for example, this will usually
configure the device to use mjpeg with libv4l2 converting it to some
format obs can use. When obs or the source is then restarted and the
"Leave Unchanged" is enabled the plugin will fail, because it will only
notice that the device is set to mjpeg, without any knowledge about the
possibility of letting libv4l2 handle the conversion.

Using the first available and supported format is not nescessarily the
best choice, but still preferable to some random format that will
cause the plugin to not capture at all. Forcing a choice here will
hopefully also make the plugin behaviour more predicatable for the user.
2015-03-01 18:53:51 +01:00
Radzaquiel b86af28380 linux-v4l2: Fix string for translation
Changed "ImageFormat" for "VideoFormat"
(checked in v4l2-input.c)
2015-02-27 00:52:17 +01:00
fryshorts 1c0df043fa linux-v4l2: Use dv timing property in source
Use the dv timing selected in the source properties to configure the
device instead of resolution/framerate.
2015-02-24 23:32:46 +01:00
fryshorts 99b6a018cc linux-v4l2: Add helper function to set dv timing
Add a helper function to set the dv timing for the input.
2015-02-24 23:32:46 +01:00
fryshorts bcf8400137 linux-v4l2: Show dv timings when supported
Show the dv timing property when the selected input supports it.
2015-02-24 23:32:46 +01:00
fryshorts 5d317920f1 linux-v4l2: Add dv timing property
Add the dv timing property and hide it by default.
2015-02-24 23:32:46 +01:00
fryshorts bf27d4c1cb linux-v4l2: Add function to list dv timings
Add a helper function to enumerate dv timings supported by the
selected input and add them to a property.
2015-02-24 23:32:46 +01:00
fryshorts 0a6cf208f1 linux-v4l2: Add helper function to get dv timings
Add a helper function to get a dv timing by index for the input.
2015-02-24 23:32:46 +01:00
fryshorts f38347acc6 linux-v4l2: Use video standard property in source
Use the video standard selected in the source properties to configure
the device instead of resolution/framerate.
2015-02-23 21:27:08 +01:00
fryshorts 7dc9069c1b linux-v4l2: Add helper function for video standard
Add a helper function to get/set the video standard for the input.
2015-02-23 21:27:08 +01:00
fryshorts a9df1d921a linux-v4l2: Use input caps for properties
Use the capabilities for the selected input to decide which properties
are enumerated and displayed.
2015-02-23 21:27:08 +01:00
fryshorts bab2aa24d5 linux-v4l2: Add video standard property
Add the video standard property and hide it by default.
2015-02-23 20:34:44 +01:00
fryshorts cc57222aa9 linux-v4l2: Add function to enum video standards
Add a helper function to enumerate video standards supported by the
selected input and add them to a property.
2015-02-23 20:34:44 +01:00
fryshorts 96b994afb2 linux-v4l2: Add helper function to get input caps
Add a helper function to get the capabilities of a specific or the
currently selected input of the device.
2015-02-23 20:34:44 +01:00
fryshorts ff8ac210fb linux-v4l2: Remove camera constraint for inputs
Remove the constraint for device inputs to be of the type "CAMERA".
This was added under the false assumption that inputs of the type
"TUNER" are only used for control purposes.
2015-02-23 20:34:44 +01:00
dodgepong 187f5181c7 Add latest translations from crowdin 2015-02-11 16:27:24 -05:00
dodgepong eb918d01b4 Add latest translations from CrowdIn 2015-02-09 19:26:17 -05:00
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