Commit Graph

587 Commits (bcf8400137ce424bd9f8d5b698fe1a4ed4f483b5)

Author SHA1 Message Date
jp9000 afbd376f71 win-capture: Add d3d8 headers
These headers allow Direct3D 8 to be used.
2014-12-09 14:21:05 -08:00
jp9000 8c3878b0b6 win-capture: Add graphics-hook-info.h
This header contains global defines, structures, and helper inline
functions for the graphics hook that will be shared between game
capture, the hook, and the get-graphics-addrs helper application.
2014-12-09 14:21:04 -08:00
jp9000 6ece794334 win-capture: Add hook helper functions for IPC
These inline functions simplify the process of using windows IPC
objects, such as mutexes and events.
2014-12-09 14:21:04 -08:00
jp9000 46aeb46757 win-capture: Add hooking functions
These functions allow the safe hooking of windows functions,
specifically windows API functions that may or may not have built-in
machine code to help aid in reverse chain hooks.

If a new hook is applied to an existing forward hook, that hook will be
preserved to prevent that new hook's data from being removed
unintentionally.

Hopefully with all these precautions this will reduce the likelihood of
crashes and abnormal hook behavior, while allowing existing hooks to be
preserved, and allowing new hooks to be applied.
2014-12-09 14:21:03 -08:00
jp9000 dcae2a0624 win-capture: Expose get_window_exe as extern
This allows get_window_exe to be used with other .c files in the module.
2014-12-08 01:53:53 -08:00
jp9000 5e2eef6231 win-capture: Fix a bug with INCLUDE_MINIMIZED
This fixes a bug where if INCLUDE_MINIMIZED was set and the window size
was (0, 0), the window would still be excluded from the resulting list
that was created.
2014-12-08 01:53:52 -08:00
jp9000 422c6ffe86 win-capture: Obfuscate OpenProcess in win-helpers
OpenProcess can often be misinterpreted as invasive.  To avoid it, a
simple obfuscation workaround does the trick.
2014-12-08 01:53:52 -08:00
jp9000 a49d731df8 win-capture: Add obfuscation functions
This adds obfuscation functions primarily for use with GetProcAddress.
This takes an obfuscated string and uses a simple integer key to
de-obfuscate it to the intended function name string, which is then
loaded dynamically using GetProcAddress.

This is typically only used with functions such as OpenProcess,
SetWindowsHookEx, and the like, which can often be misinterpreted the
wrong way by security programs if those strings are found within the
strings segment of a scanned executable.
2014-12-08 01:53:51 -08:00
jp9000 7bf69e8a0a win-capture: Always set class/title/exe to null
When getting the class/title/exe of a particular window handle in the
build_window_strings function, always set the class/title/exe pointers
to null to prevent any potential references to invalid values if any of
them do not happen to be set for whatever reason.
2014-12-08 01:53:51 -08:00
Jim 963f052c2f Merge pull request #303 from fryshorts/xshm-different-xserver
linux-xshm: Allow capturing from a different X server
2014-11-19 16:22:34 -08:00
fryshorts cc56634e91 linux-xshm: Handle missing screens.
This adds a check to the screen enumeration in order to handle missing
screens by adding them to the list but disabling them.
2014-11-20 00:14:10 +01:00
fryshorts 67ca94f7e4 linux-xshm: Add server property.
This adds a property to the source properties which lets the user
specify the X server to capture from. Since this is probably something
thats only useful under certain circumstances it is implemented as
an advanced setting which is only shown when the corresponding option
for advanced settings is checked.
2014-11-20 00:10:11 +01:00
fryshorts 04a7db867f linux-xshm: Refactoring of setup code.
This moves the code to start/stop the capture to respectively named
function in order to clean up the update function.
This means that the capture is stopped/started whenever the settings are
changed. While this increases overhead for some settings, this will also
enable future settings that require a full restart of capture process.
2014-11-18 21:03:50 +01:00
fryshorts a4d09fe742 linux-xshm: Small change for texture update function.
This removes the entering/leaving of the graphics context from this
function and requires the calling code to make sure the context is
present.
2014-11-18 21:03:50 +01:00
fryshorts cc52b432e7 linux-xshm: Improve geometry update function.
This adds the screen id from the source properties to the source
struct and changes the geometry function to use that value instead
of requiring the settings object of the source.
2014-11-18 21:03:50 +01:00
fryshorts 08c9f39220 linux-xshm: Use macro for logging.
This adds a macro to automatically prepend the plugin name to debug
statements like it is done in other plugins.
2014-11-18 21:03:50 +01:00
fryshorts 1a51d5fab7 linux-xshm: Improve source struct.
This adds documentation to the source struct and moves one bool to the
end to avoid a hole due to alignment.
2014-11-18 21:03:50 +01:00
Lexsus a2deddfa77 text-freetype2: Fix CR char. rendering as space
On windows, carriage return characters are used along with line feed
characters. When the carriage return is used, it's rendered as a space.
This removes carriage returns from strings before rendering them via
freetype.
2014-11-18 04:04:54 -08:00
Lexsus 9c34be8af1 obs-outputs: Allow blank RTMP stream key usage
Allows a blank stream key to be used for RTMP streams.
2014-11-18 03:45:49 -08:00
jp9000 ce99829d01 text-freetype2: Remove null pointer dereference 2014-11-17 06:47:49 -08:00
jp9000 f199e2c096 text-freetype2: Do not call wcslen in loop expr.
Doing this in the expression will cause it to execute the function every
time the expression is evaluated, which is needless cycles wasted.
Instead, call wcslen before the loops begin.
2014-11-17 06:47:49 -08:00
jp9000 ae862c16a6 obs-ffmpeg: If ffaac is used, change cutoff freq
If FFmpeg's experimental aac encoder is used, this changes the cutoff
frequency to better values in order to try to help make up for the
inherent lack of encoder quality a bit.  If FFmpeg is compiled to use
another encoder by default, these settings will not be applied.
2014-11-17 06:47:48 -08:00
Zachary Lund ab7fa5bdb4 linux-capture: Add X border option to xcomposite
XComposite, which is currently our only capture method for windows,
doesn't handle X border width. This works in a lot of cases but anytime
there's a border, a bug occurs where the lower right is clipped.  This
patch has two goals:

1) To position and size the capture texture correctly in accordance to
the border.

2) Adds a configuration option to allow people to toggle it (which in
most cases will simply do nothing) with a default of not including it.
2014-11-09 22:17:45 -08:00
jp9000 28ac194257 text-freetype2: Fix null pointer dereference
Somehow, there were fonts with empty face names.  Regardless, it's
always important to check your pointers.  Invalid pointers spell doom.
2014-10-31 20:39:37 -07:00
Palana a21a369ec9 mac-syphon: Track inject status and retry injecting if needed
Some applications defer loading OpenGL until after they are visible as
running applications, which causes SyphonInject to not install a server
on the first try (e.g. Minecraft does this)
2014-11-01 03:07:06 +01:00
Palana dfbe7156be mac-syphon: List bundle identifier and pid in case of duplicate names 2014-11-01 03:07:06 +01:00
Palana b766faedb3 mac-syphon: Inject the best match(es) only 2014-11-01 03:07:06 +01:00
Palana 20f805a850 mac-syphon: Keep old inject settings in case of partial match
In some cases the actual application (bundle identifier) would get
overwritten with a wrapper application bundle identifier when the
application names matched (this happened with e.g., Minecraft)
2014-11-01 03:07:05 +01:00
Palana 56d220395e mac-syphon: Move release calls to helper function 2014-11-01 03:07:05 +01: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
Jim b539a5304c Merge pull request #289 from Gol-D-Ace/remove-twitch-ingest-server
Remove ingest server live-ord.twitch.tv from services.json
2014-10-27 13:28:18 -07:00
Gol-D-Ace ebffa6b47c Remove ingest server live-ord.twitch.tv from services.json
Server doesn't exist anymore
https://api.twitch.tv/kraken/ingests
http://blog.twitch.tv/2014/09/service-update-chicago-point-of-presence-closure/
2014-10-27 21:00:34 +01:00
Palana 26964634d1 mac-syphon: Add "Allow Transparency" property
Transparency is now disabled by default, so that alpha values from
injected back buffers don't propagate to OBS (e.g. Minecraft doesn't
render properly in OBS unless "Allow Transparency" is disabled)
2014-10-27 01:01:14 +01: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 3d29662084 linux-pulseaudio: Force stereo if unknown layout
This adds a check to change the capture settings to use 2 channels when
a channel number is encountered that would otherwise be interpreted as
SPEAKERS_UNKNOWN.
2014-10-18 14:47:54 -07:00
jp9000 89591843dc linux-pulseaudio: Use defaults for pa_buffer_attr
Although these values aren't used in capture mode, set these to the
default values just to be safe.
2014-10-18 14:45:05 -07:00
fryshorts d82f986ebd linux-pulseaudio: Fix the default req. buffer len
This changes the the requested buffer length to 25ms.
2014-10-18 14:44:30 -07:00
jp9000 9898060223 win-capture: Separate window finding source code
Because other capture methods may end up needing to share this code,
separate the window finding source code to window-helpers.c and
window-helpers.h.

This include a function to fill out a property list with windows, a
function to find a window based upon priority/title/class/exe, and a
function to decode the window title/class/exe strings from a window
setting string.
2014-10-17 04:15:57 -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
Manuel Kroeber a7af7ccbfe Add monitor selection and basic properties 2014-10-14 20:45:16 +02:00
Manuel Kroeber ff2c7bd9de Fix for enum_monitors
Function enum_monitors would always stop after first found monitor due to wrong return value.
2014-10-14 20:41:56 +02:00
Manuel Kroeber fa1b9a9048 Use of text macros instead of direct obs_module_text calls 2014-10-14 20:41:05 +02:00
jp9000 e14f0fe56b win-dshow: Fix integer size conversion warnings 2014-10-11 21:18:34 -07:00
Ben Torell 958b5c12de Latest translations from Crowdin 2014-10-11 18:47:35 -04:00
Jim 8dead6a948 Merge pull request #272 from palana/syphon
Add mac-syphon plugin
2014-10-10 17:44:24 -07:00
Christoph Hohmann ed1430622b Force PulseAudio sample format if the source format is not supported by OBS
If the sample format used by PulseAudio can not be converted into an
OBS audio format it will be handled as AUDIO_FORMAT_UNKNOWN which will
not result in a proper audio recording. So instead we request a format
that OBS supports from PulseAudio and let it do the format conversion.
2014-10-08 00:05:11 +02:00
Christoph Hohmann 8166932d00 Fix PulseAudio audio format to OBS audio format mapping
The format PA_SAMPLE_S24_32LE is a 24 bit audio format in 32 bit integers
and not a 32 bit audio format and so it should no be mapped to
AUDIO_FORMAT_32BIT.
2014-10-07 21:56:32 +02:00
jp9000 4e308c955d linux-pulseaudio: Use interpolated system timing
Before it was giving timestamps based upon system time for each new
segment of audio data.  Also, it was subtracting pulse latency from the
audio timestamp, which seems like it was really meant for use with the
pulse audio time rather than system time.

Now, it just uses system time for timestamps.  Still might not be
totally perfect, but seems to be much better than it was.

This also removes the latency calculation.  Latency is no longer used
because we're not using pulseaudio timing.
2014-10-06 18:49:53 -04:00
jp9000 164f9b4517 linux-pulseaudio: Use inline for small functions 2014-10-06 18:49:53 -04:00
Palana 019a70f0d4 Add mac-syphon plugin
Allows adding Syphon servers as sources, and provides game-capture if
used with SyphonInject (specifically the scripting additions have to be
installed for SyphonInject to work from within OBS)
2014-10-04 17:26:29 +02:00
Palana 802ae79601 mac-capture: Use obs_get_default_rect_effect 2014-10-03 23:53:37 +02:00
Palana abb95781dd mac-capture: Rename display_capture::draw_effect to …::effect 2014-10-03 23:53:37 +02:00
Palana 9c4024f5b3 Implement 'update_properties' for mac-avcapture 2014-10-01 15:48:16 +02:00
Palana 94a93abb2b (API Change) Pass data to get_properties when possible 2014-10-01 15:39:57 +02:00
BtbN 599febcb54 cmake: Replace FFMpeg modules with single module
Now using components instead of one find_package call per module
2014-09-27 09:41:13 -07: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
jp9000 d753cee1e7 win-dshow: Update libdshowcapture to 0.3.3
Adds full support for the HD-PVR Rocket
2014-09-23 04:56:39 -07:00
jp9000 46c0dd7ffb win-dshow: Change FFmpeg MPGA decoder
Apparently MPGA is equivalent to MP2, not MP1.
2014-09-23 04:56:33 -07:00
jp9000 1ccc03308d win-dshow: Add debug macros for logging timestamps 2014-09-23 04:56:32 -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
jp9000 f0568f772d Update libdshowcapture to 0.3.2 2014-09-14 18:36:47 -07:00
jp9000 4e78635764 win-dshow: Use a single thread per device
This prevents certain issues I've encountered with devices where they
expect to shut down in a specific thread they started up in, as well as
a number of other issues, such as the configuration dialogs.

The configuration dialogs require that a message loop be present, and
this was not the case previously because everything was in the video
thread, which has no windows-specific code.

Configuration/crossbar/etc dialogs will now execute correctly.
2014-09-12 20:36:34 -07:00
jp9000 1291351a2a win-dshow: Properly log colorspace on format fail 2014-09-12 20:36:34 -07:00
jp9000 8bdc967ae9 win-dshow: Implement dynamic format change support
This adds support for dynamic format changes on the fly.  Format,
resolution, sample rate, can all now be changed by the current
directshow device on the fly.
2014-09-12 20:36:34 -07:00
jp9000 24ae80a481 win-dshow: Implement decoding of encoded devices 2014-09-12 20:36:33 -07:00
jp9000 2378ecdbb5 win-dshow: Clear video/audio frame data on init 2014-09-12 20:36:33 -07:00
jp9000 755f95a3a7 win-dshow: Add FFmpeg decoding support 2014-09-12 20:36:32 -07:00
jp9000 bf1fea3494 win-dshow: Allow automatic handling of source res
On an asynchronous video source, the source resolution is automatically
handled by the core, and set to the resolution of the last video data
that was sent.  There is no need to manually specify a resolution.
2014-09-12 20:36:32 -07:00
Jim 07c2d32a68 Merge pull request #261 from fryshorts/pulse-input
Use default source settings for recording in pulse input
2014-09-12 13:03:54 -07:00
jp9000 febede1fde Update libdshowcapture to 0.2.3 (Fix audio assert) 2014-09-06 14:37:52 -07:00
jp9000 4cb0c0c6f0 Update libdshowcapture to 0.2.2 (fix for HD-PVR 1) 2014-09-06 14:15:01 -07:00
jp9000 f3c47796ab Update libdshowcapture to 0.2.1 (HD-PVR 1 support) 2014-09-06 14:00:47 -07:00
jp9000 6c14dbe6ff Update libdshowcapture to 0.2.0 2014-09-06 12:45:21 -07:00
jp9000 20e005e34a win-dshow: Swap UYVY and YVYU formats
These values were erroneously using their opposing types for the source
frame format.
2014-09-04 14:02:32 -07:00
jp9000 cabc47c147 Add more null pointer checks to text source 2014-09-02 20:44:50 -07:00
jp9000 8d76f940c6 Add null pointer check for text file
Apparently there was no check for a null pointer file name.
2014-09-02 18:22:44 -07:00
fryshorts 2fca3b38e8 Log average latency in pulse input
This adds another statistics counter to the pulse plugin in order
to print the average latency reported by pulse when the source is
destroyed.
2014-09-02 19:35:17 +02:00
jp9000 02d408c730 win-dshow: Remove MPEG2 (unlikely to be used) 2014-09-01 17:09:58 -07:00
fryshorts 164c2e01b9 Small coding style fixes in pulse input 2014-08-30 21:07:03 +02:00
fryshorts de3c7cafcc Simplify logging in pulse input
Use a macro to prefix debugging messages instead of prepending manually.
2014-08-30 21:07:03 +02:00
fryshorts b6482d8995 Use source instead of server info to get format for recording in pulse input
When setting up the capture, the plugin will now query pulse for the default
format of the specific source instead of the server.
This is useful if a source has different settings than what the defaults are
for the server, e.g. when the source is an output with 5.1 surround sound
and the microphone input is mono while the server defaults to stereo sound.
2014-08-30 21:07:03 +02:00
fryshorts bbc62f2602 Add function to get info on a specific source to pulse wrapper 2014-08-30 21:07:03 +02:00
Zachary Lund 0f228e6ee5 No need to subtract window position from translated coordinates 2014-08-30 13:09:00 -05:00
jp9000 66e8674100 linux-capture: Add cursor capture to xcomposite 2014-08-29 17:20:26 -07:00
jp9000 0102896328 linux-capture: Add x/y cursor position vars 2014-08-29 17:20:26 -07:00
jp9000 378e910ad3 linux-capture: Rename pos_* vars to render_*
the pos_x and pos_y variables were somewhat deceptive, because they were
not actually the poition of the cursor.  They represented the position
of the cursor's bitmap on the screen, not the position of the cursor.
2014-08-29 17:20:26 -07:00
jp9000 15fb027647 Combine linux-xcomposite and linux-capture (xshm) 2014-08-29 17:20:02 -07:00
jp9000 a9cd60a78f Rename linux-xshm module to linux-capture 2014-08-29 17:19:30 -07:00
jp9000 f50aa5e01b win-dshow: Add audio support
This implements audio support, allowing not only the ability to capture
the built-in audio from the video device's audio capture pin, but also
the ability to override the default audio with a custom audio device.

The DShowInput::Update function was split up and refactored a bit, as it
was getting a bit large and messy.
2014-08-28 18:34:36 -07:00
Jim 3539932d86 Merge pull request #260 from fryshorts/pulse-input
Handle audio channels correctly in pulseaudio plugin
2014-08-28 12:10:24 -07:00
fryshorts 964d6eb3db Handle audio channels correctly in pulseaudio plugin
This fixes a bug where the pulseaudio plugin always reported
a speaker layout of stereo to obs, regardless of how many channels
pulseaudio actually recorded.
If the default number of channels was different to 2 this would
cause audio distortion.
2014-08-28 20:23:28 +02:00
jp9000 1a5989a52b Update win-dshow to latest libdshowcapture ver
This makes win-dshow use the new std::function callbacks instead of the
old C-style callbacks.
2014-08-28 11:06:54 -07:00
jp9000 8ef8f52ff7 win-dshow: Change a few functions to static/inline 2014-08-28 10:09:53 -07:00
jp9000 e33d567abe text-freetype2: Do not use fontconfig for mac
Originally, I tested the fontconfig code on mac and it was working
swimmingly.  However, it seems to be related to the fact that I am using
the ports/homebrew version of fontconfig.  Most users do not have that
version, and instead use the system built-in version of fontconfig,
which apparently does not find any mac fonts..  at all.  So, this
reverts the mac code to the older mac code we were using to manually
find and associate fonts with font files on the mac.
2014-08-26 12:43:33 -07:00
jp9000 53b0d9d16f text-freetype2: Split find-font-windows.c
This moves font-finding code that can be shared to find-font.c.
2014-08-26 12:41:18 -07:00
jp9000 25fa0c0fd7 text-freetype2: Warn if no font file found 2014-08-26 10:25:49 -07:00
jp9000 ab4efe4dd1 text-freetype2: Fix null poitner dereference 2014-08-26 10:20:13 -07:00
dodgepong a221fee3d2 Add latest translations from CrowdIn 2014-08-25 14:41:52 -07:00
jp9000 ff9c0528b7 text-freetype2: Check for 2 bytes instead of 1 2014-08-25 09:14:20 -07:00
jp9000 07c46ab468 text-freetype2: Fix GCC fread warnings
GCC marks fread as a function that will throw a warning if you do not
use its return value.  This is most likely done as a measure to ensure
code security.
2014-08-25 09:10:57 -07:00
jp9000 07d099bd1e text-freetype2: Localize text file path filter 2014-08-25 09:10:29 -07:00
jp9000 19b82af4ce obs-x264: Ignore certain custom opts
These options should not be set via encoder settings, and may result in
unpredictable behavior.
2014-08-25 08:46:48 -07:00
jp9000 938b7c4395 text-freetype2: Fix 'text file' property filter
The text file filter accidentally said "All font files (*.txt)" instead
of saying "Text files (*.txt)".  Probably just a mistake from a
copy&paste.
2014-08-25 08:46:47 -07:00
jp9000 a3266df836 obs-x264: Log preset/profile/tune and custom opts 2014-08-25 08:46:44 -07:00
jp9000 3dfaf57102 obs-x264: Log settings after custom opts parsed
The log of the settings didn't take in to account the potential of
custom x264 options.  This changes it to log the actual x264 settings
after parsing.
2014-08-25 08:46:08 -07:00
jp9000 8bfdabd0cf obs-x264: Swap preset/profile parameters
The parameters for override_base_params were being used in the wrong
order.
2014-08-25 08:44:53 -07:00
jp9000 29bf574d70 obs-x264: Ensure preset/tune are valid
If tune or preset is invalid it'll just cause x264 to not load at all,
which I feel is a bit over the top.  Instead, if the values aren't
valid, then just make it default to no tune if the tune is invalid, and
'veryfast' preset if the preset is invalid.
2014-08-25 08:41:40 -07:00
jp9000 d95d20aa46 text-freetype2: Avoid spamming the log
When polling the file for changes, if the file doesn't exist, avoid
repeating the message over and over again that it couldn't find the
file.
2014-08-24 16:59:02 -07:00
jp9000 4ec0861481 text-freetype2: Avoid memory leak
Doing just return could cause it to bypass the font_obj cleanup
2014-08-24 16:58:28 -07:00
jp9000 50b80925e3 text-freetype2: Check if using file with from_file 2014-08-24 16:56:34 -07:00
jp9000 93d9317b7d text-freetype2: Fix issues with text file loading 2014-08-24 16:38:37 -07:00
Palana 2deb796f49 Request high performance mode when using x264 encoder
This should probably be reevaluated once we have
global hotkeys or other functions that would require
OBS to not be sent to sleep while in the background
without having any sort of encoder running
2014-08-24 20:35:10 +02:00
jp9000 ec4016cafd Use better default fonts
On windows, Arial is probably one of the most commonly used.  Mac,
Helvetica.  The rest, Sans Serif.
2014-08-24 08:43:28 -07:00
jp9000 0fca88dde9 Do not draw text from file if file not found 2014-08-24 08:31:03 -07:00
fryshorts 774731fbaf Use fontconfig for linux/mac
This uses fontconfig for looking up font files for freetype to use on
both linux and mac.  It's apparently a bit more optimal and prevents us
from having to worry about the load time on the mac version as well.

Refactored and moved all the old code to the find-font-windows.c file,
as it's no longer used on anything but windows.
2014-08-23 18:25:00 -07:00
jp9000 428c89ad4a Remove unused variable 2014-08-23 18:20:23 -07:00
Palana b0e119a475 Remove unused variable 2014-08-23 01:27:22 +02:00
BtbN 5ec0d2ded4 Fix FindFreetype naming and find logic
Freetype is quite complicated, copied most of the logic from the
original FindFreetype module.
2014-08-21 16:36:21 +02:00
BtbN 997b4f9161 Fix FindIconv naming consistency 2014-08-21 15:28:44 +02:00
Jim ffe74f5903 Merge pull request #252 from palana/mac-window-capture
Add window capture options for OSX
2014-08-21 05:52:51 -07:00
jp9000 cf1b106a26 Fix null pointer dereference
When looking up translated font names within font files, it was not
checking for null on the 'charset' variable (the translation character
set wasn't added/availble).
2014-08-20 16:46:50 -07:00
Jim 911c885b3b Merge pull request #253 from drekryan/patch-1
Remove Justin.tv references/service
2014-08-20 16:13:07 -07:00
Derrick Lambert 1b4d8221dd Remove Justin.tv references/service 2014-08-20 18:41:18 -04:00
jp9000 5291760cf8 Fix gs_matrix_* issues
Multiplication of the matricies was being done in the wrong direction.
This caused source transformations to come out looking incorrect, for
example the linux-xshm source's cursor would not be drawn correctly or
in the right position if the source was moved/scaled/rotated.  The
problem just turned out to be that the gs_matrix_* functions were
multiplying in the wrong direction.  Reverse the direction of
multiplication, and the problem is solved.
2014-08-20 13:04:13 -07:00
Palana f8ed37dec4 Add Window Capture to mac-capture plugin 2014-08-20 00:50:18 +02:00
Palana 7b6c4a130a Add Display Capture crop modes 2014-08-20 00:50:17 +02:00
Palana bc64fa97a0 Add CoreGraphics window utilities 2014-08-20 00:42:56 +02:00
BtbN 02725acdd4 Fix double invocation of install_obs_plugin in every single plugin 2014-08-19 14:24:59 +02:00
benklett f2723aa11e Fix the cmake code for text-freetype2
it is now possible to build text-freetype2 on linux if you comment out a return() otherwise there would have been an error
Also i made the word iconv in find_package lower case, to match the APPLE cmake code
2014-08-19 13:57:22 +02:00
Jim a0897b0adf Merge pull request #243 from jp9000/font-test-mac
Merge freetype text plugin
2014-08-19 03:01:10 -07:00
jp9000 7f0ae838d7 Add system font lookup for mac/windows
This changes the font plugin from using a font file to using a specific
installed system font, which is searched for on each specific system and
associated with the font file.  It now uses a font property instead of a
path property, and font size has been removed because the font property
now handles that.

When the module is first loaded, it will build up a list of system fonts
in order to be usable by Freetype.  It was quite painful to program this
because font files can contain multiple localized versions of their face
names, and then there was the issue where windows likes to mangle
custom style types to the font name.  Regardless, it all seems to have
worked out pretty well.

Minor issues:
- Truetype/Opentype fonts sometimes do not automatically have
  italic and/or bold styles available, it seems that the system applies
  transformations manually in those cases.  We don't do this yet,
  however, so right now a user might select a font with italic/bold
  only to discover that italic/bold doesn't always work.  Not entirely
  sure what to do about this yet.  There's probably a freetype function
  to do something like that somehow,

This also requires that iconv be used for non-windows systems to be able
to look up localized font names within font files.  Windows will use
the win32 API and code page IDs to translate font names.
2014-08-19 02:11:37 -07:00
fryshorts 8f206def32 Fix cursor position in xshm plugin
By premultiplying the cursor translation the cursor is positioned
relative, and thus correctly, when the source has transformations
applied to it.
2014-08-18 20:19:26 +02:00
paibox e1611b431c Merge Freetype text plugin 2014-08-18 00:14:02 -07:00
Jim 69b9e722b8 Merge pull request #234 from fryshorts/v4l2-input
Make input selectable in v4l2 plugin.
2014-08-14 00:24:48 -07:00
jp9000 38d2cf591d Use the correct logging name for FLV outputs 2014-08-12 01:08:23 -07:00
jp9000 6680d3230a Improve FLV output logging
Log when the FLV file output has started and when it has finished.
2014-08-12 01:00:12 -07: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 f75a1ebf63 Plugins: Use new encoder/output size functions 2014-08-10 17:10:20 -07:00
jp9000 7608f77e8b (API Change) Rename autoselect/default functions
For the sake of consistency, renamed these two functions to include
_value at the end so they are consistent.

Renamed:                         To:
-------------------------------------------------------
obs_data_has_default             obs_data_has_default_value
obs_data_has_autoselect          obs_data_has_autoselect_value
obs_data_item_has_default        obs_data_item_has_default_value
obs_data_item_has_autoselect     obs_data_item_has_autoselect_value
2014-08-09 14:36:38 -07:00
jp9000 5780f3f177 (API Change) Improve graphics API consistency
Summary:
- Prefix all graphics subsystem names with gs_ or GS_
- Unsquish funciton names (for example _setfloat to _set_float)
- Changed create functions to be more consistent with the rest of the
  API elsewhere.  For exmaple, instead of
  gs_create_texture/gs_texture_destroy, it's now
  gs_texture_create/gs_texture_destroy
- Renamed gs_stencil_op enum to gs_stencil_op_type

From:                            To:
-----------------------------------------------------------
tvertarray                       gs_tvertarray
vb_data                          gs_vb_data
vbdata_create                    gs_vbdata_create
vbdata_destroy                   gs_vbdata_destroy
shader_param                     gs_shader_param
gs_effect                        gs_effect
effect_technique                 gs_effect_technique
effect_pass                      gs_effect_pass
effect_param                     gs_effect_param
texture_t                        gs_texture_t
stagesurf_t                      gs_stagesurf_t
zstencil_t                       gs_zstencil_t
vertbuffer_t                     gs_vertbuffer_t
indexbuffer_t                    gs_indexbuffer_t
samplerstate_t                   gs_samplerstate_t
swapchain_t                      gs_swapchain_t
texrender_t                      gs_texrender_t
shader_t                         gs_shader_t
sparam_t                         gs_sparam_t
effect_t                         gs_effect_t
technique_t                      gs_technique_t
eparam_t                         gs_eparam_t
device_t                         gs_device_t
graphics_t                       graphics_t
shader_param_type                gs_shader_param_type
SHADER_PARAM_UNKNOWN             GS_SHADER_PARAM_UNKNOWN
SHADER_PARAM_BOOL                GS_SHADER_PARAM_BOOL
SHADER_PARAM_FLOAT               GS_SHADER_PARAM_FLOAT
SHADER_PARAM_INT                 GS_SHADER_PARAM_INT
SHADER_PARAM_STRING              GS_SHADER_PARAM_STRING
SHADER_PARAM_VEC2                GS_SHADER_PARAM_VEC2
SHADER_PARAM_VEC3                GS_SHADER_PARAM_VEC3
SHADER_PARAM_VEC4                GS_SHADER_PARAM_VEC4
SHADER_PARAM_MATRIX4X4           GS_SHADER_PARAM_MATRIX4X4
SHADER_PARAM_TEXTURE             GS_SHADER_PARAM_TEXTURE
shader_param_info                gs_shader_param_info
shader_type                      gs_shader_type
SHADER_VERTEX                    GS_SHADER_VERTEX
SHADER_PIXEL                     GS_SHADER_PIXEL
shader_destroy                   gs_shader_destroy
shader_numparams                 gs_shader_get_num_params
shader_getparambyidx             gs_shader_get_param_by_idx
shader_getparambyname            gs_shader_get_param_by_name
shader_getviewprojmatrix         gs_shader_get_viewproj_matrix
shader_getworldmatrix            gs_shader_get_world_matrix
shader_getparaminfo              gs_shader_get_param_info
shader_setbool                   gs_shader_set_bool
shader_setfloat                  gs_shader_set_float
shader_setint                    gs_shader_set_int
shader_setmatrix3                gs_shader_setmatrix3
shader_setmatrix4                gs_shader_set_matrix4
shader_setvec2                   gs_shader_set_vec2
shader_setvec3                   gs_shader_set_vec3
shader_setvec4                   gs_shader_set_vec4
shader_settexture                gs_shader_set_texture
shader_setval                    gs_shader_set_val
shader_setdefault                gs_shader_set_default
effect_property_type             gs_effect_property_type
EFFECT_NONE                      GS_EFFECT_NONE
EFFECT_BOOL                      GS_EFFECT_BOOL
EFFECT_FLOAT                     GS_EFFECT_FLOAT
EFFECT_COLOR                     GS_EFFECT_COLOR
EFFECT_TEXTURE                   GS_EFFECT_TEXTURE
effect_param_info                gs_effect_param_info
effect_destroy                   gs_effect_destroy
effect_gettechnique              gs_effect_get_technique
technique_begin                  gs_technique_begin
technique_end                    gs_technique_end
technique_beginpass              gs_technique_begin_pass
technique_beginpassbyname        gs_technique_begin_pass_by_name
technique_endpass                gs_technique_end_pass
effect_numparams                 gs_effect_get_num_params
effect_getparambyidx             gs_effect_get_param_by_idx
effect_getparambyname            gs_effect_get_param_by_name
effect_updateparams              gs_effect_update_params
effect_getviewprojmatrix         gs_effect_get_viewproj_matrix
effect_getworldmatrix            gs_effect_get_world_matrix
effect_getparaminfo              gs_effect_get_param_info
effect_setbool                   gs_effect_set_bool
effect_setfloat                  gs_effect_set_float
effect_setint                    gs_effect_set_int
effect_setmatrix4                gs_effect_set_matrix4
effect_setvec2                   gs_effect_set_vec2
effect_setvec3                   gs_effect_set_vec3
effect_setvec4                   gs_effect_set_vec4
effect_settexture                gs_effect_set_texture
effect_setval                    gs_effect_set_val
effect_setdefault                gs_effect_set_default
texrender_create                 gs_texrender_create
texrender_destroy                gs_texrender_destroy
texrender_begin                  gs_texrender_begin
texrender_end                    gs_texrender_end
texrender_reset                  gs_texrender_reset
texrender_gettexture             gs_texrender_get_texture
GS_BUILDMIPMAPS                  GS_BUILD_MIPMAPS
GS_RENDERTARGET                  GS_RENDER_TARGET
gs_device_name                   gs_get_device_name
gs_device_type                   gs_get_device_type
gs_entercontext                  gs_enter_context
gs_leavecontext                  gs_leave_context
gs_getcontext                    gs_get_context
gs_renderstart                   gs_render_start
gs_renderstop                    gs_render_stop
gs_rendersave                    gs_render_save
gs_getinput                      gs_get_input
gs_geteffect                     gs_get_effect
gs_create_effect_from_file       gs_effect_create_from_file
gs_create_effect                 gs_effect_create
gs_create_vertexshader_from_file gs_vertexshader_create_from_file
gs_create_pixelshader_from_file  gs_pixelshader_create_from_file
gs_create_texture_from_file      gs_texture_create_from_file
gs_resetviewport                 gs_reset_viewport
gs_set2dmode                     gs_set_2d_mode
gs_set3dmode                     gs_set_3d_mode
gs_create_swapchain              gs_swapchain_create
gs_getsize                       gs_get_size
gs_getwidth                      gs_get_width
gs_getheight                     gs_get_height
gs_create_texture                gs_texture_create
gs_create_cubetexture            gs_cubetexture_create
gs_create_volumetexture          gs_voltexture_create
gs_create_zstencil               gs_zstencil_create
gs_create_stagesurface           gs_stagesurface_create
gs_create_samplerstate           gs_samplerstate_create
gs_create_vertexshader           gs_vertexshader_create
gs_create_pixelshader            gs_pixelshader_create
gs_create_vertexbuffer           gs_vertexbuffer_create
gs_create_indexbuffer            gs_indexbuffer_create
gs_gettexturetype                gs_get_texture_type
gs_load_defaultsamplerstate      gs_load_default_samplerstate
gs_getvertexshader               gs_get_vertex_shader
gs_getpixelshader                gs_get_pixel_shader
gs_getrendertarget               gs_get_render_target
gs_getzstenciltarget             gs_get_zstencil_target
gs_setrendertarget               gs_set_render_target
gs_setcuberendertarget           gs_set_cube_render_target
gs_beginscene                    gs_begin_scene
gs_draw                          gs_draw
gs_endscene                      gs_end_scene
gs_setcullmode                   gs_set_cull_mode
gs_getcullmode                   gs_get_cull_mode
gs_enable_depthtest              gs_enable_depth_test
gs_enable_stenciltest            gs_enable_stencil_test
gs_enable_stencilwrite           gs_enable_stencil_write
gs_blendfunction                 gs_blend_function
gs_depthfunction                 gs_depth_function
gs_stencilfunction               gs_stencil_function
gs_stencilop                     gs_stencil_op
gs_setviewport                   gs_set_viewport
gs_getviewport                   gs_get_viewport
gs_setscissorrect                gs_set_scissor_rect
gs_create_texture_from_iosurface gs_texture_create_from_iosurface
gs_create_gdi_texture            gs_texture_create_gdi
gs_is_compressed_format          gs_is_compressed_format
gs_num_total_levels              gs_get_total_levels
texture_setimage                 gs_texture_set_image
cubetexture_setimage             gs_cubetexture_set_image
swapchain_destroy                gs_swapchain_destroy
texture_destroy                  gs_texture_destroy
texture_getwidth                 gs_texture_get_width
texture_getheight                gs_texture_get_height
texture_getcolorformat           gs_texture_get_color_format
texture_map                      gs_texture_map
texture_unmap                    gs_texture_unmap
texture_isrect                   gs_texture_is_rect
texture_getobj                   gs_texture_get_obj
cubetexture_destroy              gs_cubetexture_destroy
cubetexture_getsize              gs_cubetexture_get_size
cubetexture_getcolorformat       gs_cubetexture_get_color_format
volumetexture_destroy            gs_voltexture_destroy
volumetexture_getwidth           gs_voltexture_get_width
volumetexture_getheight          gs_voltexture_get_height
volumetexture_getdepth           gs_voltexture_getdepth
volumetexture_getcolorformat     gs_voltexture_get_color_format
stagesurface_destroy             gs_stagesurface_destroy
stagesurface_getwidth            gs_stagesurface_get_width
stagesurface_getheight           gs_stagesurface_get_height
stagesurface_getcolorformat      gs_stagesurface_get_color_format
stagesurface_map                 gs_stagesurface_map
stagesurface_unmap               gs_stagesurface_unmap
zstencil_destroy                 gs_zstencil_destroy
samplerstate_destroy             gs_samplerstate_destroy
vertexbuffer_destroy             gs_vertexbuffer_destroy
vertexbuffer_flush               gs_vertexbuffer_flush
vertexbuffer_getdata             gs_vertexbuffer_get_data
indexbuffer_destroy              gs_indexbuffer_destroy
indexbuffer_flush                gs_indexbuffer_flush
indexbuffer_getdata              gs_indexbuffer_get_data
indexbuffer_numindices           gs_indexbuffer_get_num_indices
indexbuffer_gettype              gs_indexbuffer_get_type
texture_rebind_iosurface         gs_texture_rebind_iosurface
texture_get_dc                   gs_texture_get_dc
texture_release_dc               gs_texture_release_dc
2014-08-09 11:57:38 -07:00
jp9000 42a0925ce1 (API Change) media-io: Improve naming consistency
Renamed:                        To:
-----------------------------------------------------------
audio_output_blocksize          audio_output_get_block_size
audio_output_planes             audio_output_get_planes
audio_output_channels           audio_output_get_channels
audio_output_samplerate         audio_output_get_sample_rate
audio_output_getinfo            audio_output_get_info
audio_output_createline         audio_output_create_line
video_output_getinfo            video_output_get_info
video_gettime                   video_output_get_time
video_getframetime              video_output_get_frame_time
video_output_width              video_output_get_width
video_output_height             video_output_get_height
video_output_framerate          video_output_get_frame_rate
video_output_num_skipped_frames video_output_get_skipped_frames
video_output_total_frames       video_output_get_total_frames
2014-08-09 11:57:37 -07:00
jp9000 9d300685ca (API Change) Unsquish libobs/util
Changed:                      To:
-----------------------------------------------------------
dstr_isempty                  dstr_is_empty
cf_lexer_gettokens            cf_lexer_get_tokens
cf_preprocessor_gettokens     cf_preprocessor_get_tokens
2014-08-09 11:57:37 -07: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 73baaa59e9 (API Change) Unsquish libobs (base) names
Previous names:             New names:
-----------------------------------------------------------
obs_view_setsource          obs_view_set_source
obs_view_getsource          obs_view_get_source
obs_source_getdisplayname   obs_source_get_display_name
obs_source_getwidth         obs_source_get_width
obs_source_getheight        obs_source_get_height
obs_filter_getparent        obs_filter_get_parent
obs_filter_gettarget        obs_filter_get_target
obs_source_filter_setorder  obs_source_filter_set_order
obs_source_getsettings      obs_source_get_settings
obs_source_getname          obs_source_get_name
obs_source_setname          obs_source_set_name
obs_source_setvolume        obs_source_set_volume
obs_source_getvolume        obs_source_get_volume
obs_scene_getsource         obs_scene_get_source
obs_scene_fromsource        obs_scene_from_source
obs_scene_findsource        obs_scene_find_source
obs_output_getdisplayname   obs_output_get_display_name
obs_output_getname          obs_output_get_name
obs_encoder_getname         obs_encoder_get_name
obs_service_getdisplayname  obs_service_get_display_name
obs_service_getname         obs_service_get_name
2014-08-08 11:04:46 -07:00
jp9000 41176eef27 (API Change) Remove obs_graphics()
API Removed:
- graphics_t obs_graphics();
Replaced With:
- void obs_enter_graphics();
- void obs_leave_graphics();

Description:
  obs_graphics() was somewhat of a pointless function.  The only time
that it was ever necessary was to pass it as a parameter to
gs_entercontext() followed by a subsequent gs_leavecontext() call after
that.  So, I felt that it made a bit more sense just to implement
obs_enter_graphics() and obs_leave_graphics() functions to do the exact
same thing without having to repeat that code.  There's really no need
to ever "hold" the graphics pointer, though I suppose that could change
in the future so having a similar function come back isn't out of the
question.

Still, this at least reduces the amount of unnecessary repeated code for
the time being.
2014-08-08 11:04:45 -07:00
jp9000 0961af6e66 (API Change) Rename source_audio structure
Rename source_audio to obs_source_audio to make it more consistent with
the rest of the API
2014-08-08 11:04:44 -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
fryshorts ca1ddd4c62 Update information provided by pulseaudio plugin to pulse.
The plugin now uses the generic name "OBS" to identify itself
to pulseaudio.

Until now the pulseaudio plugin used a placeholder icon for the
mixer to display. Now that we have a real icon installed to the
system we can use that instead.
2014-08-05 21:17:19 +02:00
jp9000 4cf68e6bee window capture: Fix defaults overriding values 2014-08-05 10:58:10 -07:00
jp9000 0f2f83d034 V4L2: Fix 'show_cursor' setting forcing default 2014-08-05 10:48:39 -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 32e668438d Fix CBR for x264 versions under 139
According to issue #204 on the obs-studio repository, always setting the
ABR rate control method fixes the issue.  I checked, and this was and
issue, and that does seem to fix the issue properly.
2014-07-29 10:42:56 -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
jp9000 59ea3becf2 (API Change) Refactor module handling
Changed API:
- char *obs_find_plugin_file(const char *sub_path);

  Changed to: char *obs_module_file(const char *file);

  Cahnge it so you no longer need to specify a sub-path such as:
  obs_find_plugin_file("module_name/file.ext")

  Instead, now automatically handle the module data path so all you need
  to do is:
  obs_module_file("file.ext")

- int obs_load_module(const char *name);

  Changed to: int obs_open_module(obs_module_t *module,
                                  const char *path,
                                  const char *data_path);
              bool obs_init_module(obs_module_t module);

  Change the module loading API so that if the front-end chooses, it can
  load modules directly from a specified path, and associate a data
  directory with it on the spot.

  The module will not be initialized immediately; obs_init_module must
  be called on the module pointer in order to fully initialize the
  module.  This is done so a module can be disabled by the front-end if
  the it so chooses.

New API:
- void obs_add_module_path(const char *bin, const char *data);

  These functions allow you to specify new module search paths to add,
  and allow you to search through them, or optionally just load all
  modules from them.  If the string %module% is included, it will
  replace it with the module's name when that string is used as a
  lookup.  Data paths are now directly added to the module's internal
  storage structure, and when obs_find_module_file is used, it will look
  up the pointer to the obs_module structure and get its data directory
  that way.

  Example:
  obs_add_module_path("/opt/obs/my-modules/%module%/bin",
                      "/opt/obs/my-modules/%module%/data");

  This would cause it to additionally look for the binary of a
  hypthetical module named "foo" at /opt/obs/my-modules/foo/bin/foo.so
  (or libfoo.so), and then look for the data in
  /opt/obs/my-modules/foo/data.

  This gives the front-end more flexibility for handling third-party
  plugin modules, or handling all plugin modules in a custom way.

- void obs_find_modules(obs_find_module_callback_t callback, void
                        *param);

  This searches the existing paths for modules and calls the callback
  function when any are found.  Useful for plugin management and custom
  handling of the paths by the front-end if desired.

- void obs_load_all_modules(void);

  Search through the paths and both loads and initializes all modules
  automatically without custom handling.

- void obs_enum_modules(obs_enum_module_callback_t callback,
                        void *param);

  Enumerates currently opened modules.
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
fryshorts b88fe5078c Remove the getwidth/getheight functions from v4l2 plugin.
Those functions are actually causing more problems than
helping out with the preview because the width/height is
updated immediately while the actual size of the frames
displayed changes later.
2014-07-26 19:29:08 +02:00
fryshorts b629087513 Reorganized data struct and update function for v4l2 plugin.
Due to the plugin creating a thread to retrieve and output the
captured image data, care must taken to not modify data the
thread reads from the outside while the thread is running.

In previous revisions some settings accessed by the capture
thread were written to in the update function which could cause
image corruption and in the worst case crashes.

The members of the data struct are now split into two groups,
those that are used by the thread while it is running and must
not be changed from the outside, and those can be changed at any
time.
2014-07-26 19:29:08 +02:00
fryshorts 05ddbeb1fe Add function to prepare frame structure to v4l2 plugin.
This adds a function to prepare the source_frame struct for use
with obs_source_output_video. Since all of the values except for
the timestamp and data pointers are known in before it makes
little sense to compute them over and over again.

Due to the fact that v4l2 uses a single continuous memory segment
for multi planar formats we can also precompute memory offsets for
the planes.
2014-07-26 19:29:08 +02:00
fryshorts a5e53d5a8d Fix handling of multiplanar pixelformats in v4l2 plugin.
The data provided by v4l2 for multiplanar formats is one
consecutive block that just needs to be splitted for obs.
2014-07-26 19:29:08 +02:00
fryshorts a6bb42c367 Display emulated formats as such in v4l2 plugin.
Formats that are emulated by v4l2 are marked by appending
"(Emulated)" to them.
2014-07-26 19:29:08 +02:00
fryshorts 9a573bb456 Replace all system calls with there counterpart in libv4l2.
By using the wrapper functions supplied by libv4l2 we gain
support for formats not natively supported by obs.
The library intercepts certain system calls to transparently
enable recoding.
2014-07-26 19:29:08 +02:00
fryshorts d6f65be966 Add libv4l2 as requirement for the v4l2 plugin.
In order to convert formats not natively supported by obs the
v4l2 userspace library is required. This patch adds a cmake
script to find the library.
2014-07-26 19:29:08 +02:00
benklett 4b2010aa4e Add 720x576 (DV-PAL) as another fallback v4l2 framesize 2014-07-25 15:46:38 +02:00
jp9000 c9e225d719 Prevent loading image files with null/empty paths 2014-07-24 00:25:59 -07:00
jp9000 6db316398b Fix x264 stdint.h message (it's already included) 2014-07-22 23:25:51 -07:00