Skip to content

Commit

Permalink
warn insuficient gStreamer version
Browse files Browse the repository at this point in the history
  * added AvCaster::App
  * added AvCasterApplication->startTimers(), AvCasterApplication->stopTimers()
  • Loading branch information
bill-auger committed Feb 18, 2016
1 parent 404a51b commit caee8a0
Show file tree
Hide file tree
Showing 10 changed files with 1,677 additions and 1,624 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AvCaster is a native GNU/linux appliction built with the [JUCE][juce] framework
### Motivation
The motivation behind this project is that streaming with a feature-rich, bleeding-edge client such as OBS and FMLE is very CPU intensive even on reasonably capable machines. In situations such as live code streaming, where the broadcast is an auxiliary concern, there is more utility in reserving those extra cycles for primary development tasks.

A command-line solution is the obvious choice for such scenarios but obviously lacks real-time control and preview. This project was created to mark a reasonable balance between headless performance and a graphical feature set. Initially a simple ffmpeg command-line launcher GUI; it has since become a gStreamer native library implementation.
A command-line solution is the obvious choice for such scenarios but obviously lacks real-time control and preview. This project was created to mark a reasonable balance between headless performance and a graphical feature set.


### Get AvCaster
Expand All @@ -40,7 +40,7 @@ The [OpenSUSE Build Service][obs] hosts AvCaster x86 and x86-64 binary package r
* OpenSuse Tumbleweed , Suse SLE 12
* Ubuntu 15.10

Follow the [instructions][obs] there to subscribe your package manager or download the latest package for your distribution directly. Let us know if you would like packaging for another architecture.
Follow the [instructions][obs] there to subscribe your package manager or download the latest package for your distribution directly. Let us know if you would like packaging for another distribution or architecture.
#### Other GNU/Linux:
Refer to "Building from Source" below.

Expand All @@ -56,7 +56,7 @@ In any case you can "Star" this repo above if you like this project or "Watch" t


### Getting Help / Bug Reporting
If AvCaster refuses to launch after changing some parameters in the GUI you can try deleting the persistent configuration file in your AppData dir (e.g. ~/.av-caster/av-caster.bin).
If AvCaster refuses to launch after changing some parameters in the GUI you can try deleting the persistent configuration file in your user AppData dir (e.g. ~/.config/av-caster/av-caster.bin).

Please report any problems on the [AvCaster Issue Tracker][tracker].

Expand Down Expand Up @@ -135,14 +135,14 @@ There were several similar projects considered for expansion before this project
* [ffmpeg-gui](http://sourceforge.net/projects/ffmpegfrontend/) - cross-platform QT basic ffmpeg launcher
* [ffmpeggui](http://sourceforge.net/projects/ffmpeg-gui/) - Win32 basic ffmpeg launcher

Also, the original ffmpeg bash script with all of the features that this project has since re-implemented is in [this gist](https://gist.github.com/bill-auger/9480205a38d9d00d2fa3) if an ultra-lightweight command-line webcasting tool is more suitable. It requires some manual configuration o/c, but is approximately twice as nice.
Also, the ffmpeg bash script that AvCaster was originally conceived to wrap is in [this gist](https://gist.github.com/bill-auger/9480205a38d9d00d2fa3) if an ultra-lightweight command-line webcasting tool is more suitable. It is capable of recording to file or streaming to an RTMP server with screen capture, webcam, text overlay, and stereo audio. It requires some manual configuration o/c, but is approximately twice as nice.


[juce]: http://juce.com/
[gstreamer]: http://gstreamer.freedesktop.org/
[lctv]: https://www.livecoding.tv/
[deb]: https://packagecloud.io/ninjam/av-caster
[wiki]: https://github.com/bill-auger/av-caster/wiki/AvCaster-Wiki
[wiki]: https://github.com/bill-auger/av-caster/wiki/
[tracker]: https://github.com/bill-auger/av-caster/issues
[gitter-img]: https://badges.gitter.im/Join%20Chat.svg
[gitter]: https://gitter.im/bill-auger/av-caster
Expand Down
50 changes: 33 additions & 17 deletions Source/AvCaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ScopedPointer<AvCasterStore> AvCaster::Store ; // Initialize()

/* AvCaster private class variables */

JUCEApplicationBase* AvCaster::App = nullptr ; // Initialize()
MainContent* AvCaster::Gui = nullptr ; // Initialize()
#ifndef DISABLE_CHAT
ScopedPointer<IrcClient> AvCaster::Irc = nullptr ; // Initialize()
Expand Down Expand Up @@ -233,8 +234,9 @@ StringArray AvCaster::GetChatNicks(ValueTree chatters_store)

/* AvCaster private class methods */

bool AvCaster::Initialize(MainContent* main_content)
bool AvCaster::Initialize(JUCEApplicationBase* main_app , MainContent* main_content)
{
App = main_app ;
Gui = main_content ;
CliParams = JUCEApplicationBase::getCommandLineParameterArray() ;

Expand Down Expand Up @@ -287,6 +289,8 @@ DEBUG_TRACE_INIT_PHASE_7

void AvCaster::Shutdown()
{
if (!IsInitialized) return ;

DisplayAlert() ;

DEBUG_TRACE_SHUTDOWN_PHASE_1
Expand All @@ -313,12 +317,16 @@ void AvCaster::HandleTimer(int timer_id)
{
switch (timer_id)
{
case APP::TIMER_HI_ID: break ;
case APP::TIMER_MED_ID: UpdateStatusGUI() ; DisplayAlert() ; break ;
case APP::TIMER_HI_ID: break ;
case APP::TIMER_MED_ID: UpdateStatusGUI() ; DisplayAlert() ; break ;
case APP::TIMER_LO_ID:
if (App->getApplicationReturnValue() != 0 && AvCaster::Alerts.size() == 0)
{ if (!IsAlertModal) { App->shutdown() ; App->quit() ; } }
#ifndef DISABLE_CHAT
case APP::TIMER_LO_ID: if (IsChatEnabled) Irc->startThread() ; break ;
else if (IsChatEnabled) Irc->startThread() ;
#endif // DISABLE_CHAT
default: break ;
break ;
default: break ;
}
}

Expand Down Expand Up @@ -353,11 +361,11 @@ void AvCaster::RefreshGui()
bool is_config_pending = bool(Store->root [CONFIG::IS_PENDING_ID]) ;
bool is_preview_on = bool(Store->config[CONFIG::PREVIEW_ID ]) &&
Gstreamer::IsPreviewEnabled ;
Component* control_component = (is_config_pending) ? static_cast<Component*>(Gui->presets ) :
static_cast<Component*>(Gui->controls) ;
Component* view_component = (is_config_pending) ? static_cast<Component*>(Gui->config ) :
(is_preview_on ) ? static_cast<Component*>(Gui->preview) :
static_cast<Component*>(Gui->chat ) ;
Component* control_component = (is_config_pending) ? static_cast<Component*>(Gui->presets ) :
static_cast<Component*>(Gui->controls ) ;
Component* view_component = (is_config_pending) ? static_cast<Component*>(Gui->config ) :
(is_preview_on ) ? static_cast<Component*>(Gui->preview ) :
static_cast<Component*>(Gui->chat ) ;

DEBUG_TRACE_REFRESH_GUI

Expand Down Expand Up @@ -477,15 +485,23 @@ DUMP_DEBUG_MEDIA_SWITCHES

bool AvCaster::ValidateEnvironment()
{
DEBUG_TRACE_VALIDATE_ENVIRONMENT

return Gstreamer::IsSufficientVersion() &&
bool is_sufficient_gst_version = Gstreamer::IsSufficientVersion() ;
#ifndef DISABLE_CHAT
IrcClient::IsSufficientVersion() &&
bool is_sufficient_irc_version = IrcClient::IsSufficientVersion() ;
#else // DISABLE_CHAT
bool is_sufficient_irc_version = true ;
#endif // DISABLE_CHAT
APP::HOME_DIR .isDirectory() &&
APP::APPDATA_DIR.isDirectory() &&
APP::VIDEOS_DIR .isDirectory() ;
bool is_valid_home_dir = APP::HOME_DIR .isDirectory() ;
bool is_valid_appdata_dir = APP::APPDATA_DIR.isDirectory() ;
bool is_valid_videos_dir = APP::VIDEOS_DIR .isDirectory() ;

DEBUG_TRACE_VALIDATE_ENVIRONMENT

if (!is_sufficient_gst_version) AvCaster::Error(GUI::GST_INSUFFICIENT_ERROR_MSG) ;
if (!is_sufficient_irc_version) AvCaster::Error(GUI::IRC_INSUFFICIENT_ERROR_MSG) ;

return is_sufficient_gst_version && is_sufficient_irc_version &&
is_valid_home_dir && is_valid_appdata_dir && is_valid_videos_dir ;
}

void AvCaster::DisplayAlert()
Expand Down
3 changes: 2 additions & 1 deletion Source/AvCaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class AvCaster
private:

// setup
static bool Initialize(MainContent* main_content) ;
static bool Initialize(JUCEApplicationBase* main_app , MainContent* main_content) ;
static void Shutdown () ;

// callbacks and event handlers
Expand All @@ -122,6 +122,7 @@ class AvCaster
static void DisplayAlert () ;


static JUCEApplicationBase* App ;
static MainContent* Gui ;
#ifndef DISABLE_CHAT
static ScopedPointer<IrcClient> Irc ;
Expand Down
8 changes: 8 additions & 0 deletions Source/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,14 @@ this->textStyleCombo ->setEnabled(false) ;
this->textPosCombo ->setEnabled(false) ;
this->interstitialText->setEnabled(false) ;
this->browseButton ->setEnabled(false) ;
this->serverButton ->setEnabled(false) ;
this->hostCombo ->setEnabled(false) ;
this->portText ->setEnabled(false) ;
this->nickText ->setEnabled(false) ;
this->passText ->setEnabled(false) ;
this->channelText ->setEnabled(false) ;
this->greetingText ->setEnabled(false) ;
this->joinPartToggle ->setEnabled(false) ;
#endif // DISABLE_GUI_CONFIG_NYI
}

Expand Down
Loading

0 comments on commit caee8a0

Please sign in to comment.