From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [ANNOUNCE] experimental alsa stream support at xawtv3
Date: Mon, 23 May 2011 17:32:17 -0300 [thread overview]
Message-ID: <4DDAC451.6000002@redhat.com> (raw)
In-Reply-To: <BANLkTinjqbU0rYnG42afw+9FywT9PBhutQ@mail.gmail.com>
Em 23-05-2011 17:19, Devin Heitmueller escreveu:
> On Mon, May 23, 2011 at 4:17 PM, Mauro Carvalho Chehab
> <mchehab@redhat.com> wrote:
>> Due to the alsa detection code that I've added at libv4l2util (at v4l2-utils)
>> during the weekend, I decided to add alsa support also on xawtv3, basically
>> to provide a real usecase example. Of course, for it to work, it needs the
>> very latest v4l2-utils version from the git tree.
>>
>> I've basically added there the code that Devin wrote for tvtime, with a few
>> small fixes and with the audio device auto-detection.
>
> If any of these fixes you made apply to the code in general, I will be
> happy to merge them into our tvtime tree. Let me know.
The code bellow will probably be more useful for you. It basically adds alsa
device autodetection. The patch is against xawtv source code, but the code
there is generic enough to be added on tvtime.
Have fun!
Mauro
diff --git a/x11/xt.c b/x11/xt.c
index 81658a0..7cf7281 100644
--- a/x11/xt.c
+++ b/x11/xt.c
@@ -22,7 +22,9 @@
#include <netinet/in.h>
#include <netdb.h>
#include <pthread.h>
-
+#ifdef HAVE_LIBV42LUTIL
+# include <get_media_devices.h>
+#endif
#if defined(__linux__)
# include <sys/ioctl.h>
#include <linux/types.h>
@@ -58,6 +60,7 @@
#include "blit.h"
#include "parseconfig.h"
#include "event.h"
+#include "alsa_stream.h"
/* jwz */
#include "remote.h"
@@ -1377,6 +1380,11 @@ grabber_init()
{
struct ng_video_fmt screen;
void *base = NULL;
+#if defined(HAVE_V4L2UTIL) && defined(HAVE_ALSA)
+ struct media_devices *md;
+ unsigned int size = 0;
+ char *alsa_cap, *alsa_out, *p;
+#endif
memset(&screen,0,sizeof(screen));
#ifdef HAVE_LIBXXF86DGA
@@ -1417,6 +1425,22 @@ grabber_init()
}
f_drv = drv->capabilities(h_drv);
add_attrs(drv->list_attrs(h_drv));
+
+#if defined(HAVE_V4L2UTIL) && defined(HAVE_ALSA)
+ /* Start audio capture thread */
+ md = discover_media_devices(&size);
+ p = strrchr(args.device, '/');
+ if (!p)
+ p = args.device;
+ alsa_cap = get_first_alsa_cap_device(md, size, p + 1);
+ alsa_out = get_first_no_video_out_device(md, size);
+
+ printf("Alsa devices: cap: %s (%s), out: %s\n", alsa_cap, args.device, alsa_out);
+
+ if (alsa_cap && alsa_out)
+ alsa_thread_startup(alsa_out, alsa_cap);
+ free_media_devices(md, size);
+#endif
}
void
next prev parent reply other threads:[~2011-05-23 20:32 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-23 20:17 [ANNOUNCE] experimental alsa stream support at xawtv3 Mauro Carvalho Chehab
2011-05-23 20:19 ` Devin Heitmueller
2011-05-23 20:30 ` Mauro Carvalho Chehab
2011-05-23 20:32 ` Mauro Carvalho Chehab [this message]
2011-05-24 6:50 ` Hans Verkuil
2011-05-24 7:21 ` Hans de Goede
2011-05-24 14:09 ` Mauro Carvalho Chehab
2011-05-24 15:55 ` Hans de Goede
2011-05-28 12:44 ` Mauro Carvalho Chehab
2011-05-28 13:01 ` Rémi Denis-Courmont
2011-05-28 14:41 ` Mauro Carvalho Chehab
2011-05-28 14:10 ` Mauro Carvalho Chehab
2011-05-28 12:55 ` Rémi Denis-Courmont
2011-05-28 14:39 ` Mauro Carvalho Chehab
2011-05-24 14:15 ` Mauro Carvalho Chehab
2011-05-24 14:57 ` Devin Heitmueller
2011-05-26 6:53 ` Hans Verkuil
2011-05-28 12:17 ` Mauro Carvalho Chehab
2011-05-28 12:26 ` Hans de Goede
2011-05-28 15:24 ` Hans Verkuil
2011-05-28 16:04 ` Mauro Carvalho Chehab
2011-05-28 16:20 ` Mauro Carvalho Chehab
2011-05-29 1:01 ` [RFCv2] Add a library to retrieve associated media devices - was: " Mauro Carvalho Chehab
2011-05-29 11:19 ` Hans Verkuil
2011-05-29 11:47 ` Andy Walls
2011-05-29 12:58 ` Mauro Carvalho Chehab
2011-05-29 11:54 ` Hans de Goede
2011-05-29 13:08 ` Mauro Carvalho Chehab
2011-05-29 13:30 ` Hans de Goede
2011-05-29 14:55 ` Mauro Carvalho Chehab
2011-05-30 7:14 ` Hans Verkuil
2011-05-30 13:15 ` Mauro Carvalho Chehab
2011-05-29 12:11 ` Mauro Carvalho Chehab
2011-05-29 14:39 ` Mauro Carvalho Chehab
2011-05-30 6:34 ` Hans Verkuil
2011-05-30 11:37 ` Mauro Carvalho Chehab
2011-05-30 6:54 ` Hans Verkuil
2011-05-30 13:03 ` Mauro Carvalho Chehab
2011-05-28 12:00 ` Mauro Carvalho Chehab
-- strict thread matches above, loose matches on Subject: below --
2011-05-24 17:26 Emil Meier
2011-05-24 17:46 ` Devin Heitmueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DDAC451.6000002@redhat.com \
--to=mchehab@redhat.com \
--cc=dheitmueller@kernellabs.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox