Commit Graph

587 Commits (bcf8400137ce424bd9f8d5b698fe1a4ed4f483b5)

Author SHA1 Message Date
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
Palana 263d4ec605 Remove unnecessary compiler flag 2014-07-21 04:49:16 +02:00
Jim eeb6fc6e9c Merge pull request #180 from fryshorts/v4l2-input
Assorted fixes for the v4l2 plugin
2014-07-18 23:54:47 -07:00
BtbN 38c2fc87aa Move all data into the subdir it belongs to
Completely removes the build dir in favor of cmake based build layouting
2014-07-19 01:38:41 +02:00
BtbN 3b26db389d Fix Jansson dependency importing 2014-07-17 18:13:25 +02:00
jp9000 a01b59fb21 Reset blend state for image source
This is more of a temporary fix for the time being, it needs to handle
blend state changes better, perhaps via push/pop of state changes
2014-07-16 14:53:21 -07:00
fryshorts 87a527701a Use default color space in v4l2 plugin 2014-07-16 23:42:55 +02:00
fryshorts ba3c093156 Add fallback sizes and framerates to v4l2 plugin.
Until a proper fix is found to support devices that use stepwise
or continuous values for framesize and framerate this adds fixed
values that can be selected.
For devices that support discrete values those are still queried
and used.
2014-07-16 23:42:55 +02:00
fryshorts 27297e7009 Add more logging to v4l2 plugin.
This adds some mostly user focused logging statements.
2014-07-16 23:42:55 +02:00
fryshorts 720f159274 Use macro for prefixing log messages in v4l2 plugin 2014-07-16 23:42:55 +02:00
fryshorts d8f3761cad Fix a possibly left open file descriptor in v4l2 plugin 2014-07-16 23:42:55 +02:00
fryshorts d03c94a000 Some minor code refactoring in v4l2 plugin
Small code changes to decrease indentation a little.
2014-07-16 23:42:55 +02:00
Palana 2920281e69 mac-avcapture: Remove debug code 2014-07-16 22:39:00 +02:00
Anry 07ac02e62b Localization correction for image plugin
Closes #181
2014-07-16 02:38:11 +02:00
jp9000 a3293c4cd6 Update libdshowcapture to the latest version 2014-07-15 08:20:47 -07:00
jp9000 4c539a427d Use OBS_CONFIG as version string for the FLV mux 2014-07-14 09:52:36 -07:00
Palana 902874e362 mac-avcapture: Fix logic error in preset list handling 2014-07-13 20:20:07 +02:00
Palana 082e1bff02 mac-avcapture: Remove default device name
No need to give it a name other than the empty string
2014-07-13 20:20:07 +02:00
jp9000 ea3e755427 Log fdk_aac module settings 2014-07-13 03:12:54 -07:00
jp9000 94d047bb69 Log FFmpeg AAC encoder settings 2014-07-13 03:10:16 -07:00
jp9000 c5667a9e46 Log x264 settings 2014-07-13 03:03:31 -07:00
jp9000 2956386109 Make x264 internal logging use the log macros 2014-07-13 03:03:07 -07:00
jp9000 2099ffc33b Fix bug where it would try to set a blank profile 2014-07-13 03:02:18 -07:00
jp9000 5b12a46d41 Use log macros for x264 2014-07-13 03:00:59 -07:00
jp9000 1188ad7561 Fix unreachable code warning 2014-07-12 12:00:12 -07:00
jp9000 f675c8029f Fix 'unused parameter' warnings on windows 2014-07-12 11:59:07 -07:00
jp9000 482791c5b6 Add locale for modules 2014-07-11 17:29:00 -07:00
jp9000 1e7a99eeb4 Rename mac display capture source file
Rename it from mac-screen-capture.m to mac-display-capture.m to be a bit
more consistent
2014-07-11 17:25:53 -07:00
fryshorts 1cf19d06f9 Fix infinite loop in v4l2 plugin
With no device present the capability callbacks would cause an
infinite loop.
2014-07-11 17:48:12 +02:00
jp9000 3394ac6488 Move mac display capture to mac-capture module
It was kind of silly that it was residing within the test-input module.
2014-07-10 21:55:46 -07:00
Jim 83c041e14f Merge pull request #152 from BtbN/cmake_fixes
Cmake fixes
2014-07-10 20:43:23 -07:00
BtbN d09f6dae1f Don't hardcode include directory for plugins 2014-07-10 14:38:46 +02:00
Timo R f7b1bfa0a8 Reverse swap red&blue logic 2014-07-10 14:35:03 +02:00
jp9000 8355e8c848 Separate x264 parameters by space
Some x264 parameters actually use the ':' character for their
parameters, so I feel like space would probably be a bit more ideal.
2014-07-09 13:57:52 -07:00
Palana 23a83054b5 Remove AV_REV_FOURCC macro from mac-avcapture 2014-07-08 14:33:29 +02:00
Palana f57cc56268 Expand frame format support for mac-avcapture
Also add a fallback conversion via AVFoundation in case the native
format isn't supported
2014-07-08 14:31:04 +02:00
Palana a5108e5fd9 Simplify timestamp handling for mac-avcapture 2014-07-08 14:31:04 +02:00
jp9000 0364672cbb rtmp-stream: Add statistics callbacks
Add callbacks for total bytes sent and number of dropped frames
2014-07-06 17:36:45 -07:00
jp9000 be2b0d1398 rtmp-stream: Change TEST_FRAMEDROPS to just sleep
Instead of making the send buffer size super small, just do a sleep when
sending data to simulate the inability to send out as much data as
desired.
2014-07-06 17:35:26 -07:00
jp9000 7dfb26eb31 Reset blend state to default after drawing 2014-07-03 14:12:48 -07:00
Palana d79b28e9ba Add FPS entries "Highest" and "Match OBS FPS" for win-dshow 2014-07-02 19:37:50 +02:00
Palana 45d42af46c Add name for VideoFormat::Any 2014-07-02 19:37:50 +02:00
Palana 1052590aa5 Implement frame rate autoselection for win-dshow device update 2014-07-02 19:37:49 +02:00
Palana 2bf0163aa5 Update config modified callbacks with disable/autoselection semantics
Autoselection is only implemented for frame rate as it doesn't make
sense to autoselect the video format (Any fills the role of library
supplied autoselection) or the resolution (it may make sense to
implement resolution matching based on the current transformation
settings in the future though)
2014-07-02 19:37:43 +02:00
Palana 2702259c75 Add DecodeDeviceId helper with DStr targets 2014-07-02 19:31:53 +02:00
Palana fdc2ebf980 Add FPS/VideoFormat to name conversion helpers 2014-07-02 19:31:52 +02:00
Palana 453a8b21cd Add device caps matching helpers 2014-07-02 18:22:03 +02:00
Palana f854ac7b78 Remove user config modifying code 2014-07-02 17:55:05 +02:00
Palana 765d2e89f4 Use <limits> instead of constant 2014-07-02 17:42:20 +02:00
Palana a7cc60ec11 Refactor resolution, frame rate, and video format matching in win-dshow 2014-07-02 17:40:55 +02:00
jp9000 0b398cfad9 rtmp-stream: Log when user stops the stream 2014-07-02 00:24:55 -07:00
jp9000 697acbb4d5 rtmp-stream: Use helper log macros
Use warn/info/debug helper macro functions to output
warnings/information/debug log data that's preformatted to include the
module and the current output name.
2014-07-02 00:20:50 -07:00
jp9000 de478d3295 Change drop threshold to macro, use milliseconds
Like with other plugins, a macro is ideal for preventing typos and
misspellings of the setting.  Also, add a property for drop threshold.
2014-07-01 15:08:01 -07:00
jp9000 a527f30b94 rtmp-output: Remove unused properties 2014-07-01 15:05:15 -07:00
jp9000 058f3ca7b0 Remove FILE_TEST macro from rtmp-stream.c 2014-07-01 13:41:55 -07:00
jp9000 5c5f63e8b8 Output version/commit to RTMP stream metadata
Might come in useful for debugging issues later on.
2014-07-01 13:41:32 -07:00
BtbN 8b14aa8f4a Add missing header to CMakeLists.txt 2014-06-28 20:54:14 +02:00
jp9000 cf0b8be3a2 Add image source plugin
A simple plugin that does nothing more than display an image file as a
source.
2014-06-28 10:35:17 -07:00
jp9000 7b12133af3 Use uint8_t* instead of void* for texture data
NOTE: In texture_setimage, I had to move variables to the top of the
scope because microsoft's C compiler will give the legacy C90 error of:
'illegal use of this type as an expression'.

To sum it up, microsoft's C compiler is still utter garbage.
2014-06-28 10:12:57 -07:00
jp9000 9478624b22 win-wasapi: Use macros instead of strings
Instead of using strings for setting names, use macros.  Macros prevent
mis-spellings, prevent usage of the wrong name, and if you get it wrong,
it will simply fail to compile, helping to ensure that the right setting
value is being used.
2014-06-28 09:03:57 -07:00
jp9000 9851c061e2 linux-xshm: Fix potentially uninitialized var. 2014-06-27 21:43:42 -07:00
Jim 8e860576ea Merge pull request #128 from palana/mac-avcapture-settings-changes
Update mac-avcapture to use recent property and data changes
2014-06-26 11:27:31 -07:00
jp9000 dbb9124bf6 Remove 'effect' param from effect param funcs
Similar to the shader functions, the effect parameter functions take
the effect as a parameter.  However, the effect parameter is pretty
pointless, because the effect parameter.. parameter stores the effect
pointer interally.
2014-06-25 22:24:27 -07:00
Palana f09f969bc0 Disable default device selection for mac-avcapture
Since adding a source now opens the config dialog for that source
the convenience gain from having a device automatically start capturing
is outweighed by the inconvenience from having captured images
unintentionally recorded/streamed
2014-06-25 23:33:26 +02:00
Palana 2b5bd11671 Implement preset auto select notification for mac-avcapture 2014-06-25 23:33:26 +02:00
Palana 77e9763747 Add disconnected (selected) devices to device list for mac-avcapture
This requires the (localized) device name to be stored
2014-06-25 23:33:26 +02:00
Palana e4601ac655 Show unsupported selected presets for mac-avcapture
Configured presets that are unsupported are now preserved in the user config,
but listed as disabled
2014-06-25 23:33:26 +02:00
Palana 847bb83007 Change preset order to highest first for mac-avcapture 2014-06-25 23:32:58 +02:00
Jim 2ea50cab36 Merge pull request #124 from jp9000/new-locale-handling
Update to new module locale API
2014-06-25 12:58:05 -07:00
jp9000 0b4a259e56 Remove 'locale' parameter from all callbacks
The locale parameter was a mistake, because it puts extra needless
burden upon the module developer to have to handle this variable for
each and every single callback function.  The parameter is being removed
in favor of a single centralized module callback function that
specifically updates locale information for a module only when needed.
2014-06-25 12:36:26 -07:00
jp9000 74b4743bce Remove 'locale' from properties
Having the value stored here is somewhat pointless, so this is one step
in fixing the locale handling.  Locale should be handled by the modules
themselves with their own loaded locale lookup information.
2014-06-25 12:36:26 -07:00
jp9000 3e5d486d24 DShow: Comment unused functions until needed 2014-06-25 01:54:34 -07:00
Christoph Hohmann fdf1b25c07 linux-xcomposite: Fix that the configuration is lost when source is recreated 2014-06-22 12:51:58 +02:00
jp9000 68f7191549 Merge branch 'v4l2-input' of https://github.com/bazukas/obs-studio into bazukas-v4l2-input 2014-06-19 21:57:42 -07:00
jp9000 b9ab48c70c linux-xshm: Fix cursor draw position
Due to the recent change with matrices, the way space is represented by
matrices is a bit different.  The matrix stack represents the view
matrix, rather than the model matrix, so the position is more
representative of the camera (view) itself, rather than that of the
objects (model).
2014-06-19 20:55:30 -07:00
Azat Khasanshin 32911f774c v4l2 plugin properties
added ability to choose device, pixel format, resolution
and frame rate
2014-06-18 23:37:19 +04:00
fryshorts 5f8a6db816 Add initial implementation of a v4l2 capture plugin
This patch adds a plugin to capture video data from v4l2 devices under linux.
2014-06-18 21:31:23 +02:00
Palana 6654473fa0 Restore compatibility with released Jansson versions 2014-06-17 17:02:41 +02:00
jp9000 7c8ef6f6ef rtmp-common: Apply service encoder settings
Common services that require specific encoder settings (specified in the
'recommended' section of the json file) will now have those encoder
settings applied before the encoders start up.

This fixes the issue with services like twitch that weren't getting
their required 2-second keyframe maximum interval set.
2014-06-16 21:39:27 -07:00
jp9000 8ab1bc8e7b win-capture: Fix bug calculating cursor position
Cursor position calculation was not taking in to account the window
client coordinates relative to the screen.
2014-06-14 23:49:35 -07:00
Palana c2eebd8d1d Remove property list prefill code in mac-avcapture 2014-06-12 02:35:35 +02:00
jp9000 5cd8304dc0 CoreAudio: Enumerate AudioDeviceID manually
Apparently, despite the fact that Apple added
kAudioHardwarePropertyTranslateUIDToDevice in 10.8, it's not actually
usable in 10.8, only 10.9.  So, instead of being able to use it like a
normal, sane person, we have to enumerate all devices manually and find
the AudioDeviceID ourselves.  A slight annoyance and a mark against
apple's competence, but audio devices should now be working again on
10.8 at least, so whatever.
2014-06-07 06:07:51 -07:00
Palana 1df433e7cc Add connect/disconnect handling for mac-avcapture 2014-06-04 20:02:03 +02:00
Palana 6eeabb6b49 Enable device selection for mac-avcapture 2014-06-04 20:02:03 +02:00
Palana 8b5891e973 Improve preset selection robustness in mac-avcapture 2014-06-04 20:02:03 +02:00
Palana f20136b96e Fix minor style-deviation in mac-avcapture 2014-06-04 20:02:03 +02:00
Palana 1c46fd27bc Move device handling in mac-avcapture to separate functions 2014-06-04 20:02:03 +02:00
Palana 9ca450426a Refactor mac-avcapture cleanup and improve session init error handling 2014-06-04 20:02:02 +02:00
Palana 994565dbfb Improve mac-avcapture logging
Log messages are now prefixed with the source name to distinguish between
multiple sources
2014-06-04 20:02:02 +02:00
jp9000 e72c0925be win-dshow module: Fix configuration issues
The biggest problem with DirectShow is that available configuration
capabilities can change if you so much as look at it the wrong way.

Previously, configuring devices often didn't configure the device
settings correctly, you would choose one setting and then another
setting wouldn't be compatible with that settings.

Let's take the terrible microsoft lifecam series for example.  First,
you'd be at 640x480 happily webcam'ing away, which is using the YUY2
format.  Then you decide "hey, this webcam resolution is a bit low.  I
would love to have it a bit high resolution so it's a bit more crisp and
clear."  You'd select 1280x720, and then suddenly the only format
supported is MJPEG output.  However, the interface has to update that
fact, it can't list YUY2 if MJPEG is the only one available for this
resolution.  This doesn't just apply to formats either, this applies to
framerates and such as well.  Some framerates will only be supported by
certain resolutions which can in turn only be supported by certain
formats.

This causes user interface for configuration to be really be a nightmare
to manage if you want these features to be available to the user.  It's
extremely annoying because you have to update all the configuration UI
after something has changed, double check the configuration values, and
if the values aren't supported, update those configuration values.
2014-05-30 19:54:58 -07:00
jp9000 040615c6bc Fix CMakeLists.txt yet again 2014-05-30 03:45:34 -07:00
jp9000 40f9448a83 Fix win-dshow module CMakeLists.txt
Didn't include the DirectShow library, and forgot to add one source file
2014-05-30 03:43:53 -07:00
jp9000 c55b1771cd Add preliminary DirectShow capture plugin
This covers the basics of devices.  Mostly functional but not at 100%
yet.  Uses 'libdshowcapture' library to capture directshow video/audio.
Both libdshowcapture and the plugin still need some work.  Should at
least capture basic webcams and capture cards for the time being.
2014-05-30 03:29:48 -07:00
jp9000 1c8e27f220 win-dshow: Add submodule 'libdshowcapture' 2014-05-30 03:17:25 -07:00
jp9000 924f780f50 WASAPI plugin: Mark parameter macro 2014-05-30 03:09:31 -07:00
jp9000 796ad99335 Plugins: Remove old dshow plugin 2014-05-30 03:09:09 -07:00
BtbN 862840b3a0 Hide librtmp symbols so they don't collide with system libraries 2014-05-24 14:13:44 +02:00
Jim df47f31e83 Merge pull request #93 from BtbN/fdk
Add libfdk_aac encoder module
2014-05-22 18:33:46 -07:00
BtbN 817c25884d Make obs-ffmpeg aac encoder output which encoder is beeing used 2014-05-23 00:06:29 +02:00
BtbN ca7ba2e234 Add libfdk encoder 2014-05-23 00:06:28 +02:00
Jim e703c92c85 Merge pull request #92 from fryshorts/pulse-input
A few smaller fixes for the pulseaudio plugin
2014-05-22 05:40:23 -07:00
BtbN e2c2e50f4c Fix ffmpeg/x264 find modules according to cmake find module naming conventions 2014-05-22 13:03:47 +02:00
jp9000 d536df30b0 Add dst_size parameter to character conv funcs
Character conversion functions did not previously ask for a maximum
buffer size for their 'dst' parameter, it's unsafe to assume some given
destination buffer may have enough size to accommodate a conversion.
2014-05-22 03:46:57 -07:00
fryshorts 65b8fb2f4e Remove pa timestamps option from pulseaudio plugin
Due to desync issues with the pa timestamps, os ones are
now the only option.
2014-05-21 22:54:23 +02:00
fryshorts e0536e70ba Fix requested latency for pulseaudio plugin
When the PA_STREAM_ADJUST_LATENCY flag is passed, pulse will interpret
the fragsize attribute as a literal targeted latency.
2014-05-21 22:54:23 +02:00
fryshorts 66d8ad8eaf Fix packet/frame counter for pulseaudio plugin
Reset the counters when the recording is stopped.
2014-05-21 22:49:34 +02:00
fryshorts ac4a054bdd Add some statistics to pulseaudio plugin
This patch adds counters for packets and frames for debugging purposes.
2014-05-19 21:28:41 +02:00
fryshorts f3d9d248b6 Fix a memory leak in pulseaudio plugin 2014-05-19 21:28:33 +02:00
fryshorts ad9d15c838 Change logging statements for pulseaudio plugin
This removes some useless and annoying logging and on the other
hand bumps the prio on more important ones.
2014-05-19 21:28:33 +02:00
jp9000 1d2e5d50a4 Add FLV file output code
This doesn't add FLV file output to the user interface yet, but we'll
get around to that eventually.  This just adds an FLV output type.

Also, removed ftello/fseeko because off_t is a really annoying data
type, and I'd rather have a firm int64_t for large sizes, so I named it
to os_fseeki64 and os_ftelli64 instead, and changed the file size
function to return an int64_t.
2014-05-16 00:18:23 -07:00
Jim f5e85e167b Merge pull request #74 from BtbN/linux_new_plugins
Add xcomposite capture
2014-05-15 02:24:26 -07:00
Jim 4d13e2fbca Merge pull request #83 from fryshorts/xshm-input
linux-xshm: added support for multi-screen setups
2014-05-15 02:24:16 -07:00
jp9000 3280cd1dbb Fix code formatting issues
80 columns limit preferably
spaces after if/for/while
KNF code styling
2014-05-15 02:18:01 -07:00
jp9000 03ca5919ce UI: Add popup warnings for connection failure
Also, check for null stream path/key in the RTMP output module.
2014-05-12 15:34:46 -07:00
Palana fa22417f8c Handle libobs fourcc byte order change in mac-avcapture 2014-05-13 00:17:12 +02:00
Palana c57d883506 Fix mac-avcapture compilation with OSX SDK version < 10.9 2014-05-13 00:14:27 +02:00
Palana e9b6d1d189 Fix typo in mac-avcapture 2014-05-13 00:10:57 +02:00
fryshorts 76d2bf2c29 Add README for the xshm plugin
The file contains some development information specific to the plugin.
2014-05-12 22:07:07 +02:00
fryshorts 071c4251d8 Add support for multi-screen setups
This patch adds support for multi-screen setups by using xinerama
information if available to determine the screen size and position.

In case xinerama is not available or not active it uses the information
provided for the x screen.

To clean up the code some generic helper functions were moved to a
separate source file.
2014-05-12 22:07:07 +02:00
fryshorts 9f76396227 Add offset to xcursor
This patch adds the option to specify an offset for the cursor position.

Small fix to texture format aswell.
2014-05-12 22:07:07 +02:00
BtbN b3adef6c8d Fix all warnings in rtmp output 2014-05-10 03:40:23 +02:00
BtbN 8dc9ca5c81 Add xcomposite capture 2014-05-09 03:12:30 +02:00
BtbN 3e224b9750 Fix mav-avcapture dependencies 2014-05-08 14:43:16 +02:00
BtbN ce542525fc Fix dependency on win32-pthreads 2014-05-08 14:43:16 +02:00
Palana cfc3f2590e Update OSX dependencies for cmake generators other than ninja/make 2014-05-08 14:31:43 +02:00
Palana b9c544969e Request global headers from ffmpeg aac encoder
FAAC and FDK AAC don't populate AVCodecContext::extradata{_size} unless
CODEC_FLAG_GLOBAL_HEADER is set
2014-05-08 14:19:10 +02:00
Palana 00bdf11649 Bypass time conversion if AVCaptureInputPort has no clock
This should add compatibility for OSX < 10.9
2014-05-05 20:31:47 +02:00
Palana c36ce49706 Minor cleanup in mac-avcapture 2014-05-05 20:31:47 +02:00
jp9000 52746c2523 Add (temporary terrible) volume controls
- Add volume control

   These volume controls are basically nothing more than sliders.  They
   look terrible and hopefully will be as temporary as they are
   terrible.

 - Allow saving of specific non-user sources via obs_load_source and
   obs_save_source functions.

 - Save data of desktop/mic audio sources (sync data, volume data, etc),
   and load the data on startup.

 - Make it so that a scene is created by default if first time using the
   application.  On certain operating systems where supported, a default
   capture will be created.  Desktop capture on mac, particularly.  Not
   sure what to do about windows because monitor capture on windows 7 is
   completely terrible and is bad to start users off with.
2014-05-03 22:54:38 -07:00
jp9000 5a3bdc413d Fix Obj-C property usage
...I really need to go through my Objective-C reading material
2014-04-29 02:33:08 -07:00
jp9000 24cf70053e Mac A/V capture: Fix minor issue
Use the port clock instead of the master clock
2014-04-29 02:27:17 -07:00
jp9000 0b5ba66b33 async vid.: Fix potential endless buffering issue
If a source with async video wasn't currently active, it would endlessly
buffer the video data, which would cause memory to grow endlessly until
available memory was extinguished.

This really needs to be replaced with a proper caching mechanism at some
point.
2014-04-28 20:38:15 -07:00
Jim 76d7126a04 Merge pull request #72 from fryshorts/pulse-input
Several Improvements to the pulseaudio capture
2014-04-28 17:39:10 -07:00
Palana 88574a27de Add basic OSX AV capture plugin
Currently only cameras using interleaved 4:2:2 YCbCr are supported, e.g.
recent internal iSight cameras
2014-04-29 00:06:12 +02:00
fryshorts 9a14661507 Add option to use alternative timestamps
With this option enabled the plugin will generate timestamps
based on the system time instead of using the ones provided by
pulse audio. This might fix problems with audio desync and may
become the default/only option in the future.
2014-04-28 22:00:04 +02:00
fryshorts 30a688e942 Implement defaults functions
The defaults functions will now return the default device for the
input/output as provided by pulseaudio.
The default output device is the monitor of the default sink.
2014-04-28 22:00:04 +02:00
fryshorts bbda252e2d Add support for changing the audio device while recording
Changing the audio device in the source properties will now cause
the plugin to switch recording to the new device.
2014-04-28 22:00:04 +02:00
Jim 160b44e417 Merge pull request #71 from fryshorts/master
Some minor fixes
2014-04-26 12:57:20 -07:00
jp9000 6347416434 obs-x264: Woops, forgot to remove .rc 2014-04-26 11:39:28 -07:00
jp9000 1a0bfe3244 obs-x264: Use regular CBR if x264 version < 139
Some linux packages on linux are way too old.  Very annoying.
2014-04-26 11:30:04 -07:00
fryshorts 48391beacd Close rtmp connection when stream is stopped.
This will close the connection to the server when the stream
is stopped.
2014-04-26 02:04:37 +02:00
jp9000 89e02ca73c obs-outputs: Log connections/disconnections 2014-04-24 21:11:46 -07:00
fryshorts 1ee4496dae Added a wrapping library for pulseaudio
The wrapping library uses a global mainloop and context which
allows operations to share the connection. The global mainloop
is created and destroyed based on internal reference counting.

The capture code won't spawn a new thread for each input anymore
but instead just create the recording stream and rely on the
threaded mainloop to execute the read callback when data is available.
2014-04-24 23:51:13 +02:00
Palana 07ab8271b6 Remove setsockopt for SIGPIPE; disable SIGPIPE via signal() on non-WIN32 2014-04-24 23:50:40 +02:00
Palana 138bf4cc1e Disable SIGPIPE for RTMP socket in librtmp 2014-04-24 23:28:12 +02:00
jp9000 8830c4102f obs-studio UI: Implement stream settings UI
- Updated the services API so that it links up with an output and
   the output gets data from that service rather than via settings.
   This allows the service context to have control over how an output is
   used, and makes it so that the URL/key/etc isn't necessarily some
   static setting.

   Also, if the service is attached to an output, it will stick around
   until the output is destroyed.

 - The settings interface has been updated so that it can allow the
   usage of service plugins.  What this means is that now you can create
   a service plugin that can control aspects of the stream, and it
   allows each service to create their own user interface if they create
   a service plugin module.

 - Testing out saving of current service information.  Saves/loads from
   JSON in to obs_data_t, seems to be working quite nicely, and the
   service object information is saved/preserved on exit, and loaded
   again on startup.

 - I agonized over the settings user interface for days, and eventually
   I just decided that the only way that users weren't going to be
   fumbling over options was to split up the settings in to simple/basic
   output, pre-configured, and then advanced for advanced use (such as
   multiple outputs or services, which I'll implement later).

   This was particularly painful to really design right, I wanted more
   features and wanted to include everything in one interface but
   ultimately just realized from experience that users are just not
   technically knowledgable about it and will end up fumbling with the
   settings rather than getting things done.

   Basically, what this means is that casual users only have to enter in
   about 3 things to configure their stream:  Stream key, audio bitrate,
   and video bitrate.  I am really happy with this interface for those
   types of users, but it definitely won't be sufficient for advanced
   usage or for custom outputs, so that stuff will have to be separated.

 - Improved the JSON usage for the 'common streaming services' context,
   I realized that JSON arrays are there to ensure sorting, while
   forgetting that general items are optimized for hashing.  So
   basically I'm just using arrays now to sort items in it.
2014-04-24 02:19:03 -07:00
jp9000 43057038fc Add 'common' and 'custom' RTMP services
This plugin is just a generic service plugin for basic RTMP streaming
service stuff.

This just has a 'common' service that has a list of common/simple
streaming services that don't have their own custom service modules, and
then a 'custom' service that allows you to enter in the stream URL and
key manually, without a service/server list.

Also, copy the jansson VS projects file (don't modify the old one) so
that it's located in the vs/2013 directory, so that other libraries can
properly link with it without having to enter in extra information just
to include jansson
2014-04-19 20:54:18 -07:00
jp9000 a4a52d1c87 Fix bug where packets weren't interleaving
Packets were not interleaving, thus new data was being sent out with
potentially non-monotonically increasing timestamps
2014-04-14 02:02:59 -07:00
BtbN 075820028f Improve bundle fixup 2014-04-13 11:05:46 -07:00
jp9000 b427397aa9 RTMP output: Implement frame drop code
A little bit of history about frame dropping:

I did a large number of experiments with frame dropping in old versions
of OBS1, and it's not an easy thing to deal with.  I tried just about
everything from standard i-frame delay, to large buffers, to dumping
packets, to super-unnecessarily-complex things that just ended up
causing more problems than they was worth.

When I did my experiments, I found that the most ideal frame drop system
(in terms of reducing the amount of total data that needed to be
dropped) was in the 0.4xx days where I had a 3 second frame-drop buffer
where I could calculate the actual buffer size in bytes, and then
intellgently choose packets in that buffer to trim it down to a specific
size while minimizing the number of p-frames and i-frames dropped, and
preventing the actual impact of dropped frames on the stream.  The
downside of it was that it required too much extra latency, and far too
many people complained about it, so it was removed in favor of the
current system.

The current system I just refer to just as 'packet dumping', which when
combined with low keyframe intervals (like most services use these
days), is the next-best method from my experience.  Just dump the buffer
when you reach a threshold of buffering (which I prefer to measure with
time rather than in size), then wait for a new i-frame.  Simple,
effective, and reduces the risk of consecutive buffering, while still
having fairly low impact on the stream output due to the low keyframe
interval of services.

By the way, audio will not (and should not ever) be dropped, lest you
end up with syncing issues (among other nasty things) specific to server
implementation.
2014-04-12 04:34:15 -07:00
jp9000 f98c006711 Merge branch 'master' of https://github.com/jp9000/obs-studio 2014-04-10 12:03:59 -07:00
jp9000 519c4f4118 Fix issue when using multiple video encoders
- Fix an issue that could occur when using more than one video encoder.
   Audio/video would not sync up correctly because they were expected to
   be paired with a particular encoder.  This simply adds a little
   helper variable to encoder packets that specifies the system time in
   microseconds.  We then use that system time to sync

 - Fix an issue with x264 with fractional FPS rates (29.97 and 59.94
   particularly) where it would create ridiculously large stream
   outputs.  The problem was that you shouldn't set the timebase_*
   variables in the x264 params manually, let x264 handle the default
   values for it and leave them at 0.

 - Make x264 use CFR output, because there's no reason to ever use VFR
   in this case.
2014-04-10 11:59:42 -07:00
Palana d0e3f0d6a3 Fix (debug build) warnings in librtmp 2014-04-08 15:57:21 +02:00
Palana d45248d6ad Add preprocessor flag for librtmp network dumps
Fixes debug compilation on non-WIN32 targets due to undefined
netstackdump(_read) symbols
2014-04-08 15:41:12 +02:00
jp9000 92522d1886 Implement RTMP module (still needs drop code)
- Implement the RTMP output module.  This time around, we just use a
   simple FLV muxer, then just write to the stream with RTMP_Write.
   Easy and effective.

 - Fix the FLV muxer, the muxer now outputs proper FLV packets.

 - Output API:
   * When using encoders, automatically interleave encoded packets
     before sending it to the output.

   * Pair encoders and have them automatically wait for the other to
     start to ensure sync.

   * Change 'obs_output_signal_start_fail' to 'obs_output_signal_stop'
     because it was a bit confusing, and doing this makes a lot more
     sense for outputs that need to stop suddenly (disconnections/etc).

 - Encoder API:
   * Remove some unnecessary encoder functions from the actual API and
     make them internal.  Most of the encoder functions are handled
     automatically by outputs anyway, so there's no real need to expose
     them and end up inadvertently confusing plugin writers.

   * Have audio encoders wait for the video encoder to get a frame, then
     start at the exact data point that the first video frame starts to
     ensure the most accrate sync of video/audio possible.

   * Add a required 'frame_size' callback for audio encoders that
     returns the expected number of frames desired to encode with.  This
     way, the libobs encoder API can handle the circular buffering
     internally automatically for the encoder modules, so encoder
     writers don't have to do it themselves.

 - Fix a few bugs in the serializer interface.  It was passing the wrong
   variable for the data in a few cases.

 - If a source has video, make obs_source_update defer the actual update
   callback until the tick function is called to prevent threading
   issues.
2014-04-07 22:00:10 -07:00
jp9000 906535022f Add window capture
Now that we have the priorties window in we can finally be able to
select windows for capture source such as window capture.  Only took
about an hour or two to write.

Also, fixed some depednency issues on winmm.lib with obs-outputs
2014-04-07 01:20:36 -07:00
Timo R 15639d928c Add compatiblity for some older ffmpeg versions 2014-04-05 16:12:32 +02:00
jp9000 bd331c8ffe Remove the weird size stuff from OBS_DECLARE_MODULE
Instead of doing this, just use macros to handle this situation.

Also, fix a minor bug in AAC encoder
2014-04-05 01:45:53 -07:00
jp9000 7bfe15e4a9 AAC: Use obs_data_set_default_int function 2014-04-05 01:17:32 -07:00
jp9000 cabe98cb4e Add FFmpeg's AAC enoder
This just adds FFmpeg's default AAC encoder as an audio encoder.  Going
to try to start getting things going with the RTMP output library next.
2014-04-05 01:13:11 -07:00
jp9000 8c74db9ffc Add packet interleaving and improve encoder API
- Add interleaving of video/audio packets for outputs that are encoded
   and expect both video and audio data, sorting the packets and sending
   them to the output when both video and audio is received.

 - Combine create and initialize callbacks for the encoder API callback
   interface.
2014-04-04 23:21:19 -07:00
Palana 42be968759 Make OBS basic and obs-ffmpeg-output use NV12 by default 2014-04-04 20:55:38 +02:00
jp9000 1bca7e0a3e Improve properties API
Improve the properties API so that it can actually respond somewhat to
user input.  Maybe later this might be further improved or replaced with
something script-based.

When creating a property, you can now add a callback to that property
that notifies when the property has been changed in the user interface.
Return true if you want the properties to be refreshed, or false if not.
Though now that I think about it I doubt there would ever be a case
where you would have this callback and *not* refresh the properties.

Regardless, this allows functions to change the values of properties or
settings, or enable/disable/hide other property controls from view
dynamically.
2014-04-04 00:30:37 -07:00
jp9000 4a652ec82d obs-output module: Fill out more functions
- Add start/stop code to obs-output module

 - Use a circular buffer for the buffered encoder packets instead of a
   dynamic array

 - Add pthreads.lib as a dependency to obs-output module on windows in
   visual studio project files

 - Fix an windows export bug for avc parsing functions on windows.
   Also, rename those functions to be more consistent with each other.

 - Make outputs use a single function for encoded data rather than
   multiple functions

 - Add the ability to make 'text' properties be passworded
2014-04-02 00:42:12 -07:00
BtbN 293fa069f0 Remove hard dependency on PulseAudio 2014-04-01 22:19:57 +02:00
BtbN 84bfb6e80b Add missing project directives 2014-04-01 21:19:31 +02:00
jp9000 c751d080e9 obs-outputs module: Use the correct deps variable 2014-04-01 12:06:17 -07:00
jp9000 0cf9e0cfdd Add preliminary FLV/RTMP output (incomplete)
- obs-outputs module:  Add preliminary code to send out data, and add
   an FLV muxer.  This time we don't really need to build the packets
   ourselves, we can just use the FLV muxer and send it directly to
   RTMP_Write and it should automatically parse the entire stream for us
   without us having to do much manual code at all.  We'll see how it
   goes.

 - libobs:  Add AVC NAL packet parsing code

 - libobs/media-io:  Add quick helper functions for audio/video to get
   the width/height/fps/samplerate/etc rather than having to query the
   info structures each time.

 - libobs (obs-output.c):  Change 'connect' signal to 'start' and 'stop'
   signals.  'start' now specifies an error code rather than whether it
   simply failed, that way the client can actually know *why* a failure
   occurred.  Added those error codes to obs-defs.h.

 - libobs:  Add a few functions to duplicate/free encoder packets
2014-04-01 11:55:18 -07:00
jp9000 ed6fc7b122 Add librtmp to obs-outputs
Note that this is a somewhat heavily modified custom version of librtmp.
I modified all the platform specific code that we were using for the
OBS1 to make it platform-independent.

I don't really like the code in this library, but it works well enough,
so I can't really fault anyone for it.  It's just very..  unclean.  Even
for a C library, quite unclean.  Some parts are also a little less safe
than I'd prefer as well.
2014-04-01 11:48:28 -07:00
jp9000 6da26a3a1c Implement encoder usage with outputs
- Make it so that encoders can be assigned to outputs.  If an encoder
   is destroyed, it will automatically remove itself from that output.
   I specifically didn't want to do reference counting because it leaves
   too much potential for unchecked references and it just felt like it
   would be more trouble than it's worth.

 - Add a 'flags' value to the output definition structure.  This lets
   the output specify if it uses video/audio, and whether the output is
   meant to be used with OBS encoders or not.

 - Remove boilerplate code for outputs.  This makes it easier to program
   outputs.  The boilerplate code involved before was mostly just
   involving connecting to the audio/video data streams directly in each
   output plugin.

   Instead of doing that, simply add plugin callback functions for
   receiving video/audio (either encoded or non-encoded, whichever it's
   set to use), and then call obs_output_begin_data_capture and
   obs_output_end_data_capture to automatically handle setting up
   connections to raw or encoded video/audio streams for the plugin.

 - Remove 'active' function from output callbacks, as it's no longer
   really needed now that the libobs output context automatically knows
   when the output is active or not.

 - Make it so that an encoder cannot be destroyed until all data
   connections to the encoder have been removed.

 - Change the 'start' and 'stop' functions in the encoder interface to
   just an 'initialize' callback, which initializes the encoder.

 - Make it so that the encoder must be initialized first before the data
   stream can be started.  The reason why initialization was separated
   from starting the encoder stream was because we need to be able to
   check that the settings used with the encoder *can* be used first.

   This problem was especially annoying if you had both video/audio
   encoding.  Before, you'd have to check the return value from
   obs_encoder_start, and if that second encoder fails, then you
   basically had to stop the first encoder again, making for
   unnecessary boilerplate code whenever starting up two encoders.
2014-03-27 21:50:15 -07:00
jp9000 d9251f9e87 Add source properties window (very preliminary)
- Add a properties window for sources so that you can now actually edit
   the settings for sources.  Also, display the source by itself in the
   window (Note: not working on mac, and possibly not working on linux).

   When changing the settings for a source, it will call
   obs_source_update on that source when you have modified any values
   automatically.

 - Add a properties 'widget', eventually I want to turn this in to a
   regular nice properties view like you'd see in the designer, but
   right now it just uses a form layout in a QScrollArea with regular
   controls to display the properties.  It's clunky but works for the
   time being.

 - Make it so that swap chains and the main graphics subsystem will
   automatically use at least one backbuffer if none was specified

 - Fix bug where displays weren't added to the main display array

 - Make it so that you can get the properties of a source via the actual
   pointer of a source/encoder/output in addition to being able to look
   up properties via identifier.

 - When registering source types, check for required functions (wasn't
   doing it before).  getheight/getwidth should not be optional if it's
   a video source as well.

 - Add an RAII OBSObj wrapper to obs.hpp for non-reference-counted
   libobs pointers

 - Add an RAII OBSSignal wrapper to obs.hpp for libobs signals to
   automatically disconnect them on destruction

 - Move the "scale and center" calculation in window-basic-main.cpp to
   its own function and in its own source file

 - Add an 'update' callback to WASAPI audio sources
2014-03-23 01:07:54 -07:00
jp9000 154e0c59e1 Use atomic functions where appropriate
Also, rename atomic functions to be consistent with the rest of the
platform/threading functions, and move atomic functions to threading*
files rather than platform* files
2014-03-16 18:26:46 -07:00
jp9000 3ed647b8a0 Set defaults automatically
Automatically query defaults for sources/outputs/encoders and set them
before calling create
2014-03-16 17:42:37 -07:00
jp9000 fd37d9e9a8 Implement encoder interface (still preliminary)
- Implement OBS encoder interface.  It was previously incomplete, but
   now is reaching some level of completion, though probably should
   still be considered preliminary.

   I had originally implemented it so that encoders only have a 'reset'
   function to reset their parameters, but I felt that having both a
   'start' and 'stop' function would be useful.

   Encoders are now assigned to a specific video/audio media output each
   rather than implicitely assigned to the main obs video/audio
   contexts.  This allows separate encoder contexts that aren't
   necessarily assigned to the main video/audio context (which is useful
   for things such as recording specific sources).  Will probably have
   to do this for regular obs outputs as well.

   When creating an encoder, you must now explicitely state whether that
   encoder is an audio or video encoder.

   Audio and video can optionally be automatically converted depending
   on what the encoder specifies.

   When something 'attaches' to an encoder, the first attachment starts
   the encoder, and the encoder automatically attaches to the media
   output context associated with it.  Subsequent attachments won't have
   the same effect, they will just start receiving the same encoder data
   when the next keyframe plays (along with SEI if any).  When detaching
   from the encoder, the last detachment will fully stop the encoder and
   detach the encoder from the media output context associated with the
   encoder.

   SEI must actually be exported separately; because new encoder
   attachments may not always be at the beginning of the stream, the
   first keyframe they get must have that SEI data in it.  If the
   encoder has SEI data, it needs only add one small function to simply
   query that SEI data, and then that data will be handled automatically
   by libobs for all subsequent encoder attachments.

 - Implement x264 encoder plugin, move x264 files to separate plugin to
   separate necessary dependencies.

 - Change video/audio frame output structures to not use const
   qualifiers to prevent issues with non-const function usage elsewhere.
   This was an issue when writing the x264 encoder, as the x264 encoder
   expects non-const frame data.

   Change stagesurf_map to return a non-const data type to prevent this
   as well.

 - Change full range parameter of video scaler to be an enum rather than
   boolean
2014-03-16 16:21:34 -07:00
jp9000 04d07831cc CoreAudio: If null device id, just set to default 2014-03-11 19:45:02 -07:00
jp9000 ae1fffef7a CoreAudio: Set default audio settings on creation
device_id would end up being null, which would mess with the functions.
2014-03-11 19:42:04 -07:00
jp9000 74a3dfcf69 Fix potential uninitialized variable
if (data->output->flags & AVFMT_RAWPICTURE)

If this was true, the 'ret' variable would be used without
initialization.
2014-03-11 16:07:22 -07:00
jp9000 6578c8b03e FFmpeg plugin: Fix null pointer reference 2014-03-11 14:46:34 -07:00
jp9000 2d6a7c89ca Remove trailing whitespaces from linux plugins 2014-03-11 10:12:54 -07:00
Jim 88e4e7f1be Merge pull request #49 from fryshorts/linux-input
linux input plugins for desktop and audio capture
2014-03-11 10:07:09 -07:00
jp9000 afc798f712 Also make sure the mutex unlocks
Otherwise deadlock
2014-03-11 09:16:16 -07:00
jp9000 c09a2efc3c FFmpeg plugin: Add a few checks to be safe
Make sure it locks the write mutex before freeing the packets, and put
the detach code in the main thread loop rather than off in a separate
function for clarity
2014-03-11 09:14:21 -07:00
fryshorts 32c8cd00c5 Fixed usage of event functions
The event functions got renamed in obs.
2014-03-11 14:16:03 +01:00
fryshorts c0ab8fadda moved and split up the linux xshm and pulseaudio capture plugins 2014-03-11 14:06:10 +01:00
jp9000 5e1cac68f4 Fix semaphore mac code and mac plugin
Didn't convert the event names and didn't have the right mac includes
2014-03-10 19:24:09 -07:00
jp9000 585fd8f969 Fix audio streaming and mac semaphores
...The reason why audio didn't work was because I overwrote the bitrate
values.

As for semaphores, mac doesn't support unnamed semaphores without using
mach semaphores.  So, I just implemented a semaphore wrapper for each
OS.
2014-03-10 19:04:00 -07:00
jp9000 806837873a CoreAudio: fix properties for input/output
Also, check that audio devices are available before setting defaults
2014-03-10 13:59:15 -07:00
jp9000 02a07ea0a0 Add preliminary streaming code for testing
- Add some temporary streaming code using FFmpeg.  FFmpeg itself is not
   very ideal for streaming; lack of direct control of the sockets and
   no framedrop handling means that FFmpeg is definitely not something
   you want to use without wrapper code.  I'd prefer writing my own
   network framework in this particular case just because you give away
   so much control of the network interface.  Wasted an entire day
   trying to go through FFmpeg issues.

   There's just no way FFmpeg should be used for real streaming (at
   least without being patched or submitting some sort of patch, but I'm
   sort of feeling "meh" on that idea)

   I had to end up writing multiple threads just to handle both
   connecting and writing, because av_interleaved_write_frame blocks
   every call, stalling the main encoder thread, and thus also stalling
   draw signals.

 - Add some temporary user interface for streaming settings.  This is
   just temporary for the time being.  It's in the outputs section of
   the basic-mode settings

 - Make it so that dynamic arrays do not free all their data when the
   size just happens to be reduced to 0.  This prevents constant
   reallocation when an array keeps going from 1 item to 0 items.  Also,
   it was bad to become dependent upon that functionality.  You must now
   always explicitly call "free" on it to ensure the data is free, and
   that's how it should be.  Implicit functionality can lead to
   confusion and maintainability issues.
2014-03-10 13:10:35 -07:00
jp9000 f2ee950746 Activate user-selected audio devices
- Fix a bug where the initial audio data insertion would cause all
   audio data to unintentionally clear (mixed up < and > operators, damn
   human error)

 - Fixed a potential interdependant lock scenario with channel mutex
   locks and graphics mutex locks.  The main video thread could lock the
   graphics mutex and then while in the graphics mutex could lock the
   channels mutex.  Meanwhile in another thread, the channel mutex could
   get locked, and then the graphics mutex would get locked, causing a
   deadlock.

   The best way to deal with this is to not let mutexes lock within
   other mutexes, but sometimes it's difficult to avoid such as in the
   main video thread.

 - Audio devices should now be functional, and the devices in the audio
   settings can now be changed as desired.
2014-03-07 17:03:34 -07:00
jp9000 2c3a3f4e65 WASAPI: Change some errors messages to warnings
There shouldn't be errors if the actual source has successfully been
created, just warnings.
2014-03-07 13:04:38 -07:00
jp9000 7d48dbb1dc Add a way to get default settings
- Implement a means of obtaining default settings for an
   input/output/encoder.  obs_source_defaults for example will return
   the default settings for a particular source type.

 - Because C++ doesn't have designated initializers, use functions in
   the WASAPI plugin to register the sources instead.
2014-03-07 06:55:21 -07:00
jp9000 2448d0f229 Load up the lists of audio devices in settings
It will now load up a the list of audio input/output devices in the
combo boxes in audio settings.
2014-03-06 07:02:25 -07:00
jp9000 4f7ab552df Reimplement monitor capture
- Implement windows monitor capture (code is so much cleaner than in
   OBS1).  Will implement duplication capture later

 - Add GDI texture support to d3d11 graphics library

 - Fix precision issue with sleep timing, you have to call
   timeBeginPeriod otherwise windows sleep will be totally erratic.
2014-03-05 10:43:14 -07:00
jp9000 3415960d02 WASAPI: Check the HRESULT values with FAILED
I can't believe I did !res there.  Well I suppose I can believe it, but
still.
2014-03-04 07:18:24 -07:00
jp9000 bec8a09bd9 CoreAudio: Separate enumeration code
The enumeration code being up at the top was making things quite messy,
so I split that code out to a separate set of files.
2014-03-04 07:10:33 -07:00
jp9000 348588254c Add WASAPI audio capture
- Add WASAPI audio capture for windows, input and output

 - Check for null pointer in os_dlopen

 - Add exception-safe 'WinHandle' and 'CoTaskMemPtr' helper classes that
   will automatically call CloseHandle on handles and call CoTaskMemFree
   on certain types of memory returned from windows functions

 - Changed the wide <-> MBS/UTF8 conversion functions so that you use
   buffers (like these functions are *supposed* to behave), and changed
   the ones that allocate to a different naming scheme to be safe
2014-03-04 07:07:13 -07:00
jp9000 2fd57ed7f5 CoreAudio: Don't reconnect if no output devices
Somehow this code didn't get included with the last commit.
2014-03-03 05:12:58 -07:00
jp9000 91644fbf23 CoreAudio: Fail if no output device found
Also, don't have it repeat trying to reconnect if no devices are found
2014-03-03 03:21:00 -07:00
jp9000 9c6da6f52d Split output/input audio capture sources
- Split input and output audio captures so that they're different
   sources.  This allows easier handling and enumeration of audio
   devices without having to do some sort of string processing.

   This way the user interface code can handle this a bit more easily,
   and so that it doesn't confuse users either.  This should be done for
   all audio capture sources for all operating systems.  You don't have
   to duplicate any code, you just need to create input/output wrapper
   functions to designate the audio as input or output before creation.

 - Make it detect soundflower and wavtap devices as mac "output" devices
   (even though they're actually input) for the mac output capture, and
   make it so that users can select a default output capture and
   automatically use soundflower or wavtap.

   I'm not entirely happy about having to do this, but because mac is
   designed this way, this is really the only way to handle it that
   makes it easier for users and UI code to deal with.

   Note that soundflower and wavtap are still also designated as input
   devices, so will still show up in input device enumeration.

 - Remove pragma messages because they were kind polluting the other
   compiler messages and just getting in the way.  In the future we can
   just do a grep for TODO to find them.

 - Redo list property again, this time using a safer internal array,
   rather than requiring sketchy array inputs.  Having functions handle
   everything behind the scenes is much safer.

 - Remove the reference counter debug log code, as it was included
   unintentionally in a commit.
2014-03-03 02:56:54 -07:00
jp9000 f716de1331 CoreAudio: Detect default device change
If the default device changes, set the reconnect interval to 200
milliseconds so it pretty much immediately tries to reinitialize the
audio with the newly selected default device.  Otherwise, use 2000
millisecond intervals, and assume disconnection.

Also, reduced FFmpeg logging to just regular FFmpeg information rather
than everything FFmpeg logs.
2014-02-28 21:46:22 -07:00
jp9000 771eac6015 Be more consistent about log levels
LOG_ERROR should be used in places where though recoverable (or at least
something that can be handled safely), was unexpected, and may affect
the user/application.

LOG_WARNING should be used in places where it's not entirely unexpected,
is recoverable, and doesn't really affect the user/application.
2014-02-28 20:02:29 -07:00