Commit Graph

381 Commits (cf3ca1d5fccbddb1b13cbd451395a82fd78f6506)

Author SHA1 Message Date
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