|
SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github. |
|
Thread Tools | Search this Thread | Display Modes |
#21
|
||||
|
||||
Quote:
and thanks
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#22
|
|||
|
|||
Ok. Wasn't sure if posting code snippets is ok. I'm new to this open source stuff.
Code:
static void pause_loop(void) { mp_cmd_t *cmd; #ifdef CONFIG_STREAM_CACHE int old_cache_fill = stream_cache_size > 0 ? cache_fill_status(mpctx->stream) : 0; #endif if (!quiet) { if (term_osd && !mpctx->sh_video) { set_osd_msg(OSD_MSG_PAUSE, 1, 0, MSGTR_Paused); update_osd_msg(); } //else // NARFLEX: SageTV we always want this Paused message since we use it to detect play state!, don't hide it with an else mp_msg(MSGT_CPLAYER, MSGL_STATUS, "\n"MSGTR_Paused "\r"); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_PAUSED\n"); } #ifdef CONFIG_GUI if (use_gui) gui(GUI_SET_STATE, (void *)GUI_PAUSE); #endif if (mpctx->video_out && mpctx->sh_video && vo_config_count) mpctx->video_out->control(VOCTRL_PAUSE, NULL); if (mpctx->audio_out && mpctx->sh_audio) mpctx->audio_out->pause(); // pause audio, keep data if possible // Also process volume/mute commands here (we don't want to have it step frames in that case) while (1) { cmd = mp_input_get_cmd(20,1,1); if (cmd == NULL) { if (mpctx->sh_video && mpctx->video_out && vo_config_count) mpctx->video_out->check_events(); #ifdef CONFIG_GUI if (use_gui) { gui(GUI_REDRAW, 0); if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos)) break; } #endif #ifdef CONFIG_MENU if (vf_menu) vf_menu_pause_update(vf_menu); #endif #ifdef CONFIG_STREAM_CACHE if (!quiet && stream_cache_size > 0) { int new_cache_fill = cache_fill_status(mpctx->stream); if (new_cache_fill != old_cache_fill) { if (term_osd && !mpctx->sh_video) { set_osd_msg(OSD_MSG_PAUSE, 1, 0, MSGTR_Paused " %d%%", new_cache_fill); update_osd_msg(); } else mp_msg(MSGT_CPLAYER, MSGL_STATUS, MSGTR_Paused " %d%%\r", new_cache_fill); old_cache_fill = new_cache_fill; } } #endif if (mpctx->sh_video) handle_udp_master(mpctx->sh_video->pts); usec_sleep(20000); } else { int usedCmd = 1; printf("cmdid=%d\n", cmd->id); switch (cmd->id) { case MP_CMD_VOLUME : { float v = cmd->args[0].v.f; // start change for absolute volume value int abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; float currVolume; if( abs ) { if (mpctx->mixer.muted) { mpctx->mixer.last_l = mpctx->mixer.last_r = v; } else mixer_setvolume(&mpctx->mixer, (float)v, (float)v ); currVolume = v; } else { if(v > 0) { if (mpctx->mixer.muted) { mpctx->mixer.last_l += mpctx->mixer.volstep; mpctx->mixer.last_r += mpctx->mixer.volstep; if (mpctx->mixer.last_l > 100) mpctx->mixer.last_l = 100; if (mpctx->mixer.last_r > 100) mpctx->mixer.last_r = 100; currVolume = mpctx->mixer.last_l; } else { mixer_incvolume(&mpctx->mixer); mixer_getbothvolume(&mpctx->mixer, &currVolume); } } else if (v < 0) { if (mpctx->mixer.muted) { mpctx->mixer.last_l -= mpctx->mixer.volstep; mpctx->mixer.last_r -= mpctx->mixer.volstep; if (mpctx->mixer.last_l < 0) mpctx->mixer.last_l = 0; if (mpctx->mixer.last_r < 0) mpctx->mixer.last_r = 0; currVolume = mpctx->mixer.last_l; } else { mixer_decvolume(&mpctx->mixer); mixer_getbothvolume(&mpctx->mixer, &currVolume); } } else { if (mpctx->mixer.muted) currVolume = mpctx->mixer.last_l; else mixer_getbothvolume(&mpctx->mixer, &currVolume); } } mp_msg(MSGT_GLOBAL,MSGL_INFO,"VOLUME=%f\n", currVolume); break; } case MP_CMD_MUTE: { mixer_mute(&mpctx->mixer); mp_msg(MSGT_GLOBAL,MSGL_INFO,"MUTED=%d\n", mpctx->mixer.muted); break; } case MP_CMD_INACTIVE_FILE : { mpctx->stream->activeFileFlag = 0; if (mpctx->stream->cache_data) { cache_vars_t* sc = mpctx->stream->cache_data; sc->streamOriginal->activeFileFlag = 0; sc->stream->activeFileFlag = 0; } } break; case MP_CMD_ACTIVE_FILE : { mpctx->stream->activeFileFlag = 1; if (mpctx->stream->cache_data) { cache_vars_t* sc = mpctx->stream->cache_data; sc->streamOriginal->activeFileFlag = 1; sc->stream->activeFileFlag = 1; } } break; case MP_CMD_VO_RECTANGLES : { int rectData[8] = { cmd->args[0].v.i, cmd->args[1].v.i, cmd->args[2].v.i, cmd->args[3].v.i, cmd->args[4].v.i, cmd->args[5].v.i, cmd->args[6].v.i, cmd->args[7].v.i }; mpctx->video_out->control(VOCTRL_RECTANGLES, rectData); break; } default: usedCmd = 0; break; } if (usedCmd) { cmd = mp_input_get_cmd(0,1,0); mp_cmd_free(cmd); } else if (cmd->pausing != 4) break; } } if (cmd && cmd->id == MP_CMD_PAUSE) { cmd = mp_input_get_cmd(0,1,0); mp_cmd_free(cmd); } mpctx->osd_function = OSD_PLAY; if (mpctx->audio_out && mpctx->sh_audio) { if (mpctx->eof) // do not play remaining audio if we e.g. switch to the next file mpctx->audio_out->reset(); else mpctx->audio_out->resume(); // resume audio } if (mpctx->video_out && mpctx->sh_video && vo_config_count) mpctx->video_out->control(VOCTRL_RESUME, NULL); // resume video (void)GetRelativeTime(); // ignore time that passed during pause #ifdef CONFIG_GUI if (use_gui) { if (guiInfo.Playing == GUI_STOP) mpctx->eof = 1; else gui(GUI_SET_STATE, (void *)GUI_PLAY); } #endif } |
#23
|
|||
|
|||
Also, new to GitHub and no account yet but at this rate I'll likely have to get on board.
|
#24
|
|||
|
|||
Looks like pasting loses all of the tabs and leading whitespace. If the code works I'll try to get you a better copy.
|
#25
|
||||
|
||||
can you post the output of
git diff mplayer.c that might be easier to pull... or, email me the entire file sean.stuckless at gmail.com
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#26
|
|||
|
|||
emailed it.
|
#27
|
||||
|
||||
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#28
|
||||
|
||||
wnjj's fixes, fixed the pause issue, so thanks for that.
Jeff, I have a couple more questions/notes... 1. -subcc now requires an integer argument, although, mplayer will still continue without it. 2. -printcc is no longer a valid mplayer option, and mplayer dies if you pass it So, for my testing, I've wrapped -subcc and -printcc args around a if (!newmplayer) check so that they don't get passed with the new mplayer build. Not quite sure how to best handle it, and I know that these a closed captioning options, but I'm not sure what the -printcc did and why it was removed... and not sure what I should pass to -subcc. http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.txt Quote:
I haven't touched any of the ffmpeg code changes that were done to mplayer, and I'm wondering, if you recall what they might be, since all the files that I've tried, appear to work fine, and I think that mplayer is only used for the miniclient desktop, correct? ie, it's not used by the server, and it's not used by the hardware clients, correct? And lastly, delivering a new mplayer build, will likely be a big changeset, since there are changes to jtux, miniclient java files, build files, jogl, etc, so I'm not sure if you want the changes in your repo, or if I should just push them to my fork, or the open sagetv fork, etc. If I get time this weekend, I'm going to push beta 32/64 bit builds of the miniclient packages for linux, so that people can test/play with it. Also, I think for now, I'm going to simply remove the "seatbelt" check for JTux (which is what I've done for testing) to allow it to operate on 64bit... So far, I haven't seen any issues with JTux, and it it's only lightly used in sagetv, so we might be fine to continue using it for now.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#29
|
||||
|
||||
Quote:
Code:
Hello! This is some indented code Blah blah blah Goodbye!
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2),USBUIRT (multi-zone) Source: Comcast/Xfinity X1 Cable Primary Client: Server Other Clients: (1) HD200, (1) HD300 Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE, HDHR, HVR-2250, HD-PVR |
#30
|
||||
|
||||
Quote:
Quote:
Quote:
__________________
Jeffrey Kardatzke Founder of SageTV |
#31
|
||||
|
||||
And for the FFMPEG code..I was going to find the one it was based off...but apparently my SageTV PC has taken a turn for the worst and has some really horrible symptoms (very corrupted BIOS screen, and I only saw it get into Windows once which then hung shortly after the splash screen....most of the time you don't even see any video output when booting it). And unfortunately the drives in it were in a RAID array with a hardware RAID card, so I can't just take them out and put them in my Linux workstation to get data off them.
I did have to figure this out again at Google at some point; and it wasn't too terrible to basically do a binary search of various versions until I found the closest one (I did it by focusing on specific files that we would have never edited and then finding the match for that one in its revision history and then repeating that with other files until I figured out where we were actually branched from).
__________________
Jeffrey Kardatzke Founder of SageTV |
#32
|
|||
|
|||
Quote:
|
#33
|
||||
|
||||
Quote:
I've been spending ALOT of time in the miniclient code these past few days, looking at everything from mplayer, opengl, communication, etc, and I have a few questions about the architecture. (some of these are statements that you can correct, if they are incorrect) Mplayer Stuff When opengl is used, I see there an opengl video renderer as well. So, for opengl, is mplayer NOT rendering the video, but instead, you are reading the frames and rendering the frames yourself by reading them from the domain socket. (-vo:stv) When opengl is NOT used, it looks it launches the mplayer with a UI and embeds it into the AWT canvas. For the opengl rendering (if I have it correct), then couldn't the mplayer instance run on the server and forward the frames to a client over a standard IP socket. Could this be used to stream to a mobile device, or would there be a more efficient way to enable this? (would I be porting mplayer to a mobile device to handle playback, etc). You must have some ideas on how video playback is/should be done on a mobile device. API Stuff The existing minicient (java) is heavily dependent on AWT (fonts, key events, mouse events, etc). I'm in the process to stripping it apart (separate project) to make it AWT independent with an AWT implementation layer. My goal is to have a base re-usable codebase for the miniclient and then provide an implementation for Android as well. A lot of this work is done, but I have a couple of questions. GFXCMD (and it's subclasses, for opengl and directx) basically handle all the graphical commands from creating the inital window to drawing artifacts, and handling all the input events. Is the render phase of this code continous, ie, rendering a complete UI 30+ times a second, or is it static where each new command simply adds to the previous state of the screen. I think it's the latter, but I just wanted to be sure. For JOGL it still uses AWT event system, and it uses AWT Fonts. I was able to get a JOGL renderer working that used opengl input events (some tweaking to bitmasks for even modifiers, since sagetv reliews on the AWT based ones), but then I huge road block on FONTS. It amazed me that opengl doesn't really have a universal text rendering api. JOGL provides a TextRenderer that uses AWT, and it has some newer font rendering that no one else can seem to figure out, incuding me If the JOGL stuff handled the font rendering independent of AWT, then it could have been used, as is, on Android... but as it stands, I can't use it. And of course, since opengl has no universal font rendering, it also means that on opengl on Android ALSO doesn't handle text rendering (easily). There are "hacks" to render text, some of which involves rendering a TextView over the canvas. IN your opengl travels have you come across the font rendering issue, and do you have any suggestions for non AWT based font rendering? I checked out LwGL but it's even in worse shape than JOGL for text rendering.. Kind of. LwGL allows you to create bitmaps of fonts and then you can use a special text renderer that will render the text as bitmaps. I'll likely have more questions later about MiniCientCOnnection.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#34
|
||||||
|
||||||
Quote:
Quote:
Quote:
And for playback on mobile clients; if they can play the format back natively...then just stream using the MediaServer just like SageTV client does (but that won't work out of the home). If you need something at a lower bitrate/resolution; then just use the same streaming that the Placeshifter client uses (that's what we did when we wrote an iOS app years ago that was never released....which is why there's HTTP Live Streaming code inside of SageTV). Quote:
Quote:
Quote:
It's all quite extensive and took loads of work to get AWT completely out of there. The Sage.jar file on the HD300 has ZERO AWT code in it. After thinking about this a little more; I would actually encourage you to NOT do this abstraction. The Placeshifter code is not that extensive. The majority of it is based around the specific implementation it is dealing with (such as DirectX, OpenGL or AWT). And for someone porting to Android; it would probably be easier to just write it all again. They could of course copy/paste big chunks of stuff to get most of the protocol handling code in there (like has already been done between the different implementations in there). The whole context for the server dialog on startup would also likely be very different on Android; so that code wouldn't really get reused at all. The amount of effort it would take you to complete this abstraction would probably be fairly equivalent to the amount of work to create the Android app itself IMHO.
__________________
Jeffrey Kardatzke Founder of SageTV |
#35
|
||||
|
||||
Quote:
Quote:
Quote:
Quote:
In the end, that's exactly what it'll be ie, I've copied the miniclient code to a new project, and I've basically started to gut and shred anything that doesn't fit into my current objective (ie, AWT stuff, Windows stuff, etc). But in the process, I'm trying to understand what is OS dependent and what is UI/AWT dependent, etc, and I'm basically structuring to code, to better support a clearer separation of OS and UI tasks. My goal is really to do this for android, but it'll likely help someone doing this for iOS as well. I don't want to re-write all of the communication code, event handling code, GFXCMD base code, etc, so I've copied them, and then gutted them.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#36
|
|||
|
|||
Just officially became an Apple developer. Curious whether porting the MiniClient to iOS or utilizing sagex would be the best course? I would like to stay away from third-party dependencies (e.g. plugins) if possible.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3 Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD |
#37
|
|||
|
|||
As a side note I believe we'll need to add the ability to encode to H.264 for mobile playback. As far as I can tell MPEG4 Part 2/H.263 playback is not supported on either Android or iOS.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3 Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD |
#38
|
||||
|
||||
Quote:
Quote:
Quote:
That's interesting....I can tell you with 100% certainty that I've placeshifted to an iPhone before (and we never did H264 transcoding). I watched Seinfield in the DFW airport that way when I was going to the FCC in DC for an AllVid session. But adding H264 transcoding shouldn't be all that hard to do....I know x264 has dynamic rate control options in it; and that was the hardest part.
__________________
Jeffrey Kardatzke Founder of SageTV |
#39
|
|||
|
|||
Quote:
Quote:
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3 Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD |
#40
|
||||
|
||||
Quote:
__________________
Jeffrey Kardatzke Founder of SageTV |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Linux 64bit MiniClient (issues with JTux on 64bit) | stuckless | SageTV Github Development | 23 | 08-19-2015 12:54 PM |
OSD doesn't work in Linux miniclient 6.6 | Grant.Edwards | SageTV Linux | 1 | 08-27-2011 04:37 PM |
Linux Placeshifter/Miniclient Fails | scsever | SageTV Linux | 1 | 08-23-2011 10:20 PM |
mplayer opens in new window in Linux | Spectrum | SageTV Linux | 3 | 08-18-2009 07:08 AM |
Running Linux Miniclient on Xbox | xred | SageTV Placeshifter | 0 | 03-06-2007 12:28 AM |