From: zhang xiaolei Date: Wed, 28 May 2014 13:41:14 +0000 (+0800) Subject: tizen ivi multimedia test suite initial release X-Git-Tag: submit/tizen/20140603.115937^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56773beaf01344417d65768d4bdc9f8b78ce4625;p=test%2Fcommon%2Fcommon-multimedia-suite.git tizen ivi multimedia test suite initial release Change-Id: I78b152af25389e59931fa12b5c72d3b7ced995d7 Signed-off-by: zhang xiaolei --- 56773beaf01344417d65768d4bdc9f8b78ce4625 diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..6d45519 --- /dev/null +++ b/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Makefile.am b/Makefile.am new file mode 100755 index 0000000..22fe44b --- /dev/null +++ b/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = ivi/gst-auto-launch/src +docdir = /usr/share/$(PACKAGE) +dist_doc_DATA = LICENSE ivi/gst-auto-launch/AUTHORS ivi/gst-auto-launch/README diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..909c52a --- /dev/null +++ b/autogen.sh @@ -0,0 +1,3 @@ +autoreconf -i +touch vala.stamp +touch ivi/gst-auto-launch/src/vala.stamp diff --git a/configure.ac b/configure.ac new file mode 100755 index 0000000..d1f7c36 --- /dev/null +++ b/configure.ac @@ -0,0 +1,29 @@ +AC_INIT([gst-auto-launch], [0.3.21], [tigrux@gmail.com], [gst-auto-launch]) +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_HEADERS(config.h) +AM_INIT_AUTOMAKE([foreign]) + +AC_PROG_CC +#AC_PROG_LIBTOOL +#AC_DISABLE_STATIC + +AC_PATH_PROG(VALAC, valac, valac) +AC_SUBST(VALAC) + +AC_SUBST(CFLAGS) +AC_SUBST(CPPFLAGS) +AC_SUBST(LDFLAGS) + +VALAFLAGS="--pkg gstreamer-1.0 --pkg gstreamer-base-1.0 --pkg posix" +AC_SUBST(VALAFLAGS) + +PKG_CHECK_MODULES(PROGRAM, gstreamer-1.0 gstreamer-base-1.0 gthread-2.0) +AC_SUBST(PROGRAM_CFLAGS) +AC_SUBST(PROGRAM_LIBS) + +AC_CONFIG_FILES([ + Makefile + ivi/gst-auto-launch/src/Makefile + ]) + +AC_OUTPUT diff --git a/ivi/gst-auto-launch/AUTHORS b/ivi/gst-auto-launch/AUTHORS new file mode 100755 index 0000000..ad42a18 --- /dev/null +++ b/ivi/gst-auto-launch/AUTHORS @@ -0,0 +1,3 @@ +- Sandino Flores + + diff --git a/ivi/gst-auto-launch/README b/ivi/gst-auto-launch/README new file mode 100755 index 0000000..057413a --- /dev/null +++ b/ivi/gst-auto-launch/README @@ -0,0 +1,49 @@ +====== Source ====== + +This code is from https://github.com/tigrux/gst-auto-launch +with version 0.3.21-0-g9f6f92a on Nov 18, 2011 + + +====== Build ====== + +One shall build this package under normal user. +./autogen.sh +./configure --prefix=/usr +make + +Or build rpm package in an rpmbuild environment. +./pack.sh + + +====== Usage ====== + +gst-auto-launch is an improved version of gst-launch that accepts commands. + +Usage: ./gst-auto-launch +Where each command is of the form : + +Supported commands are: + pause: + Change pipeline state to PAUSED + seek: + Seek to the specified time + null: + Change pipeline state to NULL + stop: + Change pipeline state to READY + eos: + Send eos to the source elements + set: + Set properties of an object + quit: + Quit the event loop + ready: + Change pipeline state to READY + play: + Change pipeline state to PLAYING + navigation: + Send the specified navigation event name to an element in the given coords + +Example: +gst-auto-launch videotestsrc ! autovideosink 0:pause 1:play +5:eos +gst-auto-launch videotestsrc ! clockoverlay name=clock ! autovideosink 0:play 2:set:clock:valignment:bottom 5:eos diff --git a/ivi/gst-auto-launch/src/Makefile.am b/ivi/gst-auto-launch/src/Makefile.am new file mode 100755 index 0000000..f0c23c0 --- /dev/null +++ b/ivi/gst-auto-launch/src/Makefile.am @@ -0,0 +1,26 @@ +AM_CPPFLAGS = $(PROGRAM_CFLAGS) + +BUILT_SOURCES = vala.stamp + +bin_PROGRAMS = gst-auto-launch + +gst_auto_launch_VALASOURCES = \ + auto-pipeline.vala \ + task-scanner.vala \ + task.vala \ + gst-auto-launch.vala \ + command.vala \ + commands.vala + +gst_auto_launch_SOURCES = \ + $(gst_auto_launch_VALASOURCES:.vala=.c) + +gst_auto_launch_LDADD = \ + $(PROGRAM_LIBS) + +vala.stamp: $(gst_auto_launch_VALASOURCES) + $(VALAC) --thread -C $(VALAFLAGS) $(gst_auto_launch_VALASOURCES) + touch $@ + +bindir=/usr/bin +EXTRA_DIST = $(bin_PROGRAMS) diff --git a/ivi/gst-auto-launch/src/auto-pipeline.c b/ivi/gst-auto-launch/src/auto-pipeline.c new file mode 100755 index 0000000..dd8f2c2 --- /dev/null +++ b/ivi/gst-auto-launch/src/auto-pipeline.c @@ -0,0 +1,417 @@ +/* auto-pipeline.c generated by valac 0.10.0, the Vala compiler + * generated from auto-pipeline.vala, do not modify */ + + +#include +#include +#include +#include +#include +#include +#include + + +#define TYPE_AUTO_PIPELINE (auto_pipeline_get_type ()) +#define AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTO_PIPELINE, AutoPipeline)) +#define AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTO_PIPELINE, AutoPipelineClass)) +#define IS_AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTO_PIPELINE)) +#define IS_AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTO_PIPELINE)) +#define AUTO_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTO_PIPELINE, AutoPipelineClass)) + +typedef struct _AutoPipeline AutoPipeline; +typedef struct _AutoPipelineClass AutoPipelineClass; +typedef struct _AutoPipelinePrivate AutoPipelinePrivate; +#define _fclose0(var) ((var == NULL) ? NULL : (var = (fclose (var), NULL))) +#define _gst_object_unref0(var) ((var == NULL) ? NULL : (var = (gst_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) + +struct _AutoPipeline { + GObject parent_instance; + AutoPipelinePrivate * priv; +}; + +struct _AutoPipelineClass { + GObjectClass parent_class; +}; + +struct _AutoPipelinePrivate { + FILE* log_stream; + gboolean _output_messages_enabled; + gint _return_status; + GstBin* _pipeline; +}; + + +extern AutoPipeline* auto_pipeline; +static gpointer auto_pipeline_parent_class = NULL; + +#define LOG_FILENAME "gst-auto-launch.log" +gint vprintf (const char* format, va_list ap); +gint vfprintf (FILE* stream, const char* format, va_list ap); +GType auto_pipeline_get_type (void) G_GNUC_CONST; +#define AUTO_PIPELINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_AUTO_PIPELINE, AutoPipelinePrivate)) +enum { + AUTO_PIPELINE_DUMMY_PROPERTY, + AUTO_PIPELINE_RETURN_STATUS, + AUTO_PIPELINE_OUTPUT_MESSAGES_ENABLED, + AUTO_PIPELINE_PIPELINE +}; +void auto_pipeline_log (AutoPipeline* self, const char* format, ...); +static void auto_pipeline_on_bus_message (AutoPipeline* self, GstMessage* message); +static gboolean _lambda0_ (GQuark q, GValue* v, AutoPipeline* self); +static gboolean __lambda0__gst_structure_foreach_func (GQuark field_id, GValue* value, gpointer self); +void auto_pipeline_set_return_status (AutoPipeline* self, gint value); +GstBin* auto_pipeline_get_pipeline (AutoPipeline* self); +gboolean auto_pipeline_set_state (AutoPipeline* self, GstState state); +GstElement* auto_pipeline_get_by_name (AutoPipeline* self, const char* name); +gboolean auto_pipeline_send_eos (AutoPipeline* self); +AutoPipeline* auto_pipeline_new (void); +AutoPipeline* auto_pipeline_construct (GType object_type); +gint auto_pipeline_get_return_status (AutoPipeline* self); +gboolean auto_pipeline_get_output_messages_enabled (AutoPipeline* self); +void auto_pipeline_set_output_messages_enabled (AutoPipeline* self, gboolean value); +void auto_pipeline_set_pipeline (AutoPipeline* self, GstBin* value); +static void _auto_pipeline_on_bus_message_gst_bus_message (GstBus* _sender, GstMessage* message, gpointer self); +static void auto_pipeline_finalize (GObject* obj); +static void auto_pipeline_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); +static void auto_pipeline_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); +static int _vala_strcmp0 (const char * str1, const char * str2); + + + +void auto_pipeline_log (AutoPipeline* self, const char* format, ...) { + va_list args_vl; + g_return_if_fail (self != NULL); + g_return_if_fail (format != NULL); + va_start (args_vl, format); + if (self->priv->log_stream != NULL) { + vfprintf (self->priv->log_stream, format, args_vl); + } + vprintf (format, args_vl); + va_end (args_vl); +} + + +static gpointer _gst_object_ref0 (gpointer self) { + return self ? gst_object_ref (self) : NULL; +} + + +static gboolean _lambda0_ (GQuark q, GValue* v, AutoPipeline* self) { + gboolean result = FALSE; + GValue _tmp0_ = {0}; + GValue vs; + vs = (g_value_init (&_tmp0_, G_TYPE_STRING), g_value_set_string (&_tmp0_, ""), _tmp0_); + g_value_transform (v, &vs); + auto_pipeline_log (self, " '%s' : '''%s''',\n", g_quark_to_string (q), g_value_get_string (&vs), NULL); + result = TRUE; + G_IS_VALUE (&vs) ? (g_value_unset (&vs), NULL) : NULL; + return result; +} + + +static gboolean __lambda0__gst_structure_foreach_func (GQuark field_id, GValue* value, gpointer self) { + gboolean result; + result = _lambda0_ (field_id, value, self); + return result; +} + + +static void auto_pipeline_on_bus_message (AutoPipeline* self, GstMessage* message) { + g_return_if_fail (self != NULL); + g_return_if_fail (message != NULL); + if (self->priv->_output_messages_enabled) { + guint32 seqnum; + GstObject* src; + const GstStructure* s; + char* src_name; + GTimeVal tv = {0}; + seqnum = gst_message_get_seqnum (message); + src = message->src; + s = gst_message_get_structure (message); + src_name = NULL; + if (GST_IS_ELEMENT (src)) { + char* _tmp0_; + src_name = (_tmp0_ = g_strdup (gst_object_get_name (src)), _g_free0 (src_name), _tmp0_); + } else { + if (GST_IS_PAD (src)) { + GstPad* pad; + char* pad_name; + GstElement* _tmp1_; + char* _tmp2_; + char* parent_name; + char* _tmp3_; + pad = _gst_object_ref0 (GST_PAD (src)); + pad_name = g_strdup (gst_object_get_name ((GstObject*) pad)); + parent_name = (_tmp2_ = g_strdup (gst_object_get_name ((GstObject*) (_tmp1_ = gst_pad_get_parent_element (pad)))), _gst_object_unref0 (_tmp1_), _tmp2_); + src_name = (_tmp3_ = g_strdup_printf ("%s:%s", parent_name, pad_name), _g_free0 (src_name), _tmp3_); + _g_free0 (parent_name); + _g_free0 (pad_name); + _gst_object_unref0 (pad); + } else { + if (GST_IS_OBJECT (src)) { + char* _tmp4_; + src_name = (_tmp4_ = g_strdup (gst_object_get_name (src)), _g_free0 (src_name), _tmp4_); + } + } + } + auto_pipeline_log (self, " {\n", NULL); + auto_pipeline_log (self, " 'seqnum' : %u,\n", seqnum, NULL); + auto_pipeline_log (self, " 'type' : '%s',\n", gst_message_type_get_name (message->type), NULL); + g_get_current_time (&tv); + auto_pipeline_log (self, " 'time' : %lu.%06lu,\n", tv.tv_sec, tv.tv_usec, NULL); + if (src_name != NULL) { + auto_pipeline_log (self, " 'src' : '%s',\n", src_name, NULL); + } + if (s != NULL) { + auto_pipeline_log (self, " 'structure' : {\n", NULL); + auto_pipeline_log (self, " 'name' : '%s',\n", gst_structure_get_name (s), NULL); + gst_structure_foreach (s, __lambda0__gst_structure_foreach_func, self); + auto_pipeline_log (self, " }\n", NULL); + } + auto_pipeline_log (self, " },\n", NULL); + _g_free0 (src_name); + } + switch (message->type) { + case GST_MESSAGE_ERROR: + { + { + GError* e; + char* s; + GError* _tmp5_ = NULL; + GError* _tmp6_; + char* _tmp7_ = NULL; + char* _tmp8_; + e = NULL; + s = NULL; + (gst_message_parse_error (message, &_tmp5_, &_tmp7_), e = (_tmp6_ = _tmp5_, _g_error_free0 (e), _tmp6_)); + s = (_tmp8_ = _tmp7_, _g_free0 (s), _tmp8_); + g_critical ("auto-pipeline.vala:100: Bus error: %s %s\n", e->message, s); + auto_pipeline_set_return_status (self, 1); + g_signal_emit_by_name (self, "quit"); + _g_free0 (s); + _g_error_free0 (e); + break; + } + } + case GST_MESSAGE_EOS: + { + { + gst_element_set_state ((GstElement*) auto_pipeline_get_pipeline (self), GST_STATE_NULL); + g_signal_emit_by_name (self, "quit"); + break; + } + } + default: + { + break; + } + } +} + + +gboolean auto_pipeline_set_state (AutoPipeline* self, GstState state) { + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + result = gst_element_set_state ((GstElement*) auto_pipeline_get_pipeline (self), state) != GST_STATE_CHANGE_FAILURE; + return result; +} + + +GstElement* auto_pipeline_get_by_name (AutoPipeline* self, const char* name) { + GstElement* result = NULL; + char* _tmp0_; + gboolean _tmp1_; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (name != NULL, NULL); + if ((_tmp1_ = _vala_strcmp0 (_tmp0_ = gst_object_get_name ((GstObject*) auto_pipeline_get_pipeline (self)), name) == 0, _g_free0 (_tmp0_), _tmp1_)) { + result = _gst_object_ref0 ((GstElement*) auto_pipeline_get_pipeline (self)); + return result; + } else { + result = gst_bin_get_by_name (auto_pipeline_get_pipeline (self), name); + return result; + } +} + + +gboolean auto_pipeline_send_eos (AutoPipeline* self) { + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + g_print ("Sending EOS to the pipeline\n"); + result = gst_element_send_event ((GstElement*) auto_pipeline_get_pipeline (auto_pipeline), gst_event_new_eos ()); + return result; +} + + +AutoPipeline* auto_pipeline_construct (GType object_type) { + AutoPipeline * self; + self = (AutoPipeline*) g_object_new (object_type, NULL); + return self; +} + + +AutoPipeline* auto_pipeline_new (void) { + return auto_pipeline_construct (TYPE_AUTO_PIPELINE); +} + + +gint auto_pipeline_get_return_status (AutoPipeline* self) { + gint result; + g_return_val_if_fail (self != NULL, 0); + result = self->priv->_return_status; + return result; +} + + +void auto_pipeline_set_return_status (AutoPipeline* self, gint value) { + g_return_if_fail (self != NULL); + self->priv->_return_status = value; + g_object_notify ((GObject *) self, "return-status"); +} + + +gboolean auto_pipeline_get_output_messages_enabled (AutoPipeline* self) { + gboolean result; + g_return_val_if_fail (self != NULL, FALSE); + result = self->priv->_output_messages_enabled; + return result; +} + + +void auto_pipeline_set_output_messages_enabled (AutoPipeline* self, gboolean value) { + gboolean _tmp0_ = FALSE; + g_return_if_fail (self != NULL); + if (!self->priv->_output_messages_enabled) { + _tmp0_ = value; + } else { + _tmp0_ = FALSE; + } + if (_tmp0_) { + FILE* _tmp1_; + self->priv->log_stream = (_tmp1_ = fopen (LOG_FILENAME, "w"), _fclose0 (self->priv->log_stream), _tmp1_); + } + self->priv->_output_messages_enabled = value; + g_object_notify ((GObject *) self, "output-messages-enabled"); +} + + +GstBin* auto_pipeline_get_pipeline (AutoPipeline* self) { + GstBin* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_pipeline; + return result; +} + + +static void _auto_pipeline_on_bus_message_gst_bus_message (GstBus* _sender, GstMessage* message, gpointer self) { + auto_pipeline_on_bus_message (self, message); +} + + +void auto_pipeline_set_pipeline (AutoPipeline* self, GstBin* value) { + GstBin* _tmp0_; + GstBus* bus; + g_return_if_fail (self != NULL); + self->priv->_pipeline = (_tmp0_ = _gst_object_ref0 (value), _gst_object_unref0 (self->priv->_pipeline), _tmp0_); + bus = _gst_object_ref0 (((GstElement*) self->priv->_pipeline)->bus); + gst_bus_add_signal_watch (bus); + g_signal_connect_object (bus, "message", (GCallback) _auto_pipeline_on_bus_message_gst_bus_message, self, 0); + _gst_object_unref0 (bus); + g_object_notify ((GObject *) self, "pipeline"); +} + + +static void auto_pipeline_class_init (AutoPipelineClass * klass) { + auto_pipeline_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (AutoPipelinePrivate)); + G_OBJECT_CLASS (klass)->get_property = auto_pipeline_get_property; + G_OBJECT_CLASS (klass)->set_property = auto_pipeline_set_property; + G_OBJECT_CLASS (klass)->finalize = auto_pipeline_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), AUTO_PIPELINE_RETURN_STATUS, g_param_spec_int ("return-status", "return-status", "return-status", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), AUTO_PIPELINE_OUTPUT_MESSAGES_ENABLED, g_param_spec_boolean ("output-messages-enabled", "output-messages-enabled", "output-messages-enabled", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), AUTO_PIPELINE_PIPELINE, g_param_spec_object ("pipeline", "pipeline", "pipeline", GST_TYPE_BIN, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_signal_new ("quit", TYPE_AUTO_PIPELINE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); +} + + +static void auto_pipeline_instance_init (AutoPipeline * self) { + self->priv = AUTO_PIPELINE_GET_PRIVATE (self); + self->priv->_return_status = 0; +} + + +static void auto_pipeline_finalize (GObject* obj) { + AutoPipeline * self; + self = AUTO_PIPELINE (obj); + _fclose0 (self->priv->log_stream); + _gst_object_unref0 (self->priv->_pipeline); + G_OBJECT_CLASS (auto_pipeline_parent_class)->finalize (obj); +} + + +GType auto_pipeline_get_type (void) { + static volatile gsize auto_pipeline_type_id__volatile = 0; + if (g_once_init_enter (&auto_pipeline_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (AutoPipelineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) auto_pipeline_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AutoPipeline), 0, (GInstanceInitFunc) auto_pipeline_instance_init, NULL }; + GType auto_pipeline_type_id; + auto_pipeline_type_id = g_type_register_static (G_TYPE_OBJECT, "AutoPipeline", &g_define_type_info, 0); + g_once_init_leave (&auto_pipeline_type_id__volatile, auto_pipeline_type_id); + } + return auto_pipeline_type_id__volatile; +} + + +static void auto_pipeline_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + AutoPipeline * self; + self = AUTO_PIPELINE (object); + switch (property_id) { + case AUTO_PIPELINE_RETURN_STATUS: + g_value_set_int (value, auto_pipeline_get_return_status (self)); + break; + case AUTO_PIPELINE_OUTPUT_MESSAGES_ENABLED: + g_value_set_boolean (value, auto_pipeline_get_output_messages_enabled (self)); + break; + case AUTO_PIPELINE_PIPELINE: + g_value_set_object (value, auto_pipeline_get_pipeline (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static void auto_pipeline_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { + AutoPipeline * self; + self = AUTO_PIPELINE (object); + switch (property_id) { + case AUTO_PIPELINE_RETURN_STATUS: + auto_pipeline_set_return_status (self, g_value_get_int (value)); + break; + case AUTO_PIPELINE_OUTPUT_MESSAGES_ENABLED: + auto_pipeline_set_output_messages_enabled (self, g_value_get_boolean (value)); + break; + case AUTO_PIPELINE_PIPELINE: + auto_pipeline_set_pipeline (self, g_value_get_object (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + +static int _vala_strcmp0 (const char * str1, const char * str2) { + if (str1 == NULL) { + return -(str1 != str2); + } + if (str2 == NULL) { + return str1 != str2; + } + return strcmp (str1, str2); +} + + + + diff --git a/ivi/gst-auto-launch/src/auto-pipeline.vala b/ivi/gst-auto-launch/src/auto-pipeline.vala new file mode 100755 index 0000000..32d732f --- /dev/null +++ b/ivi/gst-auto-launch/src/auto-pipeline.vala @@ -0,0 +1,136 @@ +const string LOG_FILENAME = "gst-auto-launch.log"; + +[PrintfFormat] +extern int vprintf(string format, va_list ap); + +[PrintfFormat] +extern int vfprintf(FileStream stream, string format, va_list ap); + + +class AutoPipeline: Object { + + public signal void quit(); + + FileStream log_stream; + + bool _output_messages_enabled; + public int return_status {get; set; default = 0;} + + public bool output_messages_enabled { + set { + if(!_output_messages_enabled && value) + log_stream = FileStream.open(LOG_FILENAME, "w"); + _output_messages_enabled = value; + } + get { + return _output_messages_enabled; + } + } + + public void log(string format, ...) { + va_list args_vl = va_list(); + if(log_stream != null) + vfprintf(log_stream, format, args_vl); + vprintf(format, args_vl); + } + + + Gst.Bin _pipeline; + + public Gst.Bin pipeline { + get { + return _pipeline; + } + + set { + _pipeline = value; + Gst.Bus bus = _pipeline.bus; + bus.add_signal_watch(); + bus.message.connect(on_bus_message); + } + } + + + void on_bus_message(Gst.Message message) { + if(_output_messages_enabled) { + uint32 seqnum = message.get_seqnum(); + unowned Gst.Object src = message.src; + unowned Gst.Structure s = message.get_structure(); + string src_name = null; + + if(src is Gst.Element) + src_name = src.name; + else if(src is Gst.Pad) { + Gst.Pad pad = (Gst.Pad)src; + string pad_name = pad.name; + string parent_name = pad.get_parent_element().name; + src_name = "%s:%s".printf(parent_name, pad_name); + } + else if(src is Gst.Object) + src_name = src.name; + + log(" {\n"); + log(" 'seqnum' : %u,\n", seqnum); + log(" 'type' : '%s',\n", message.type.to_string()); + TimeVal tv = TimeVal(); + log(" 'time' : %lu.%06lu,\n", tv.tv_sec, tv.tv_usec); + if(src_name != null) + log(" 'src' : '%s',\n", src_name); + if(s != null) { + log(" 'structure' : {\n"); + log(" 'name' : '%s',\n", s.get_name()); + s.foreach( + (q, v) => { + Value vs = ""; + v.transform(ref vs); + log(" '%s' : '''%s''',\n", q.to_string(), vs.get_string()); + return true; + }); + log(" }\n"); + } + log(" },\n"); + + } + + switch(message.type) { + case Gst.MessageType.ERROR: { + Error e; + string s; + message.parse_error(out e, out s); + critical("Bus error: %s %s\n", e.message, s); + return_status = 1; + quit(); + break; + } + case Gst.MessageType.EOS: { + pipeline.set_state(Gst.State.NULL); + quit(); + break; + } + default: + break; + } + } + + + public bool set_state(Gst.State state) { + return pipeline.set_state(state) != Gst.StateChangeReturn.FAILURE; + } + + + public Gst.Element? get_by_name(string name) { + if(pipeline.get_name() == name) + return pipeline; + else + return pipeline.get_by_name(name); + } + + + public bool send_eos() { + print("Sending EOS to the pipeline\n"); + return auto_pipeline.pipeline.send_event(new Gst.Event.eos()); + + return true; + } +} + diff --git a/ivi/gst-auto-launch/src/command.c b/ivi/gst-auto-launch/src/command.c new file mode 100755 index 0000000..56ffd96 --- /dev/null +++ b/ivi/gst-auto-launch/src/command.c @@ -0,0 +1,124 @@ +/* command.c generated by valac 0.10.0, the Vala compiler + * generated from command.vala, do not modify */ + + +#include +#include +#include +#include + + +#define TYPE_AUTO_PIPELINE (auto_pipeline_get_type ()) +#define AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTO_PIPELINE, AutoPipeline)) +#define AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTO_PIPELINE, AutoPipelineClass)) +#define IS_AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTO_PIPELINE)) +#define IS_AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTO_PIPELINE)) +#define AUTO_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTO_PIPELINE, AutoPipelineClass)) + +typedef struct _AutoPipeline AutoPipeline; +typedef struct _AutoPipelineClass AutoPipelineClass; + +#define TYPE_TASK (task_get_type ()) +#define TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK, Task)) +#define TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK, TaskClass)) +#define IS_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK)) +#define IS_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK)) +#define TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASK, TaskClass)) + +typedef struct _Task Task; +typedef struct _TaskClass TaskClass; + +#define TYPE_COMMAND (command_get_type ()) +typedef struct _Command Command; +#define _g_free0(var) (var = (g_free (var), NULL)) + +typedef gint (*CommandFunc) (AutoPipeline* auto_pipeline, Task* task); +struct _Command { + char* name; + char* description; + char* args_desc; + CommandFunc function; +}; + + + +GType auto_pipeline_get_type (void) G_GNUC_CONST; +GType task_get_type (void) G_GNUC_CONST; +GType command_get_type (void) G_GNUC_CONST; +Command* command_dup (const Command* self); +void command_free (Command* self); +void command_copy (const Command* self, Command* dest); +void command_destroy (Command* self); +gchar command_get_arg_desc (Command *self, guint arg_i); +guint command_get_n_args (Command *self); + + + +static glong string_get_length (const char* self) { + glong result; + g_return_val_if_fail (self != NULL, 0L); + result = g_utf8_strlen (self, (gssize) (-1)); + return result; +} + + +gchar command_get_arg_desc (Command *self, guint arg_i) { + gchar result = '\0'; + if (arg_i >= string_get_length ((*self).args_desc)) { + result = (gchar) 0; + return result; + } + result = (gchar) g_utf8_get_char (g_utf8_offset_to_pointer ((*self).args_desc, arg_i)); + return result; +} + + +guint command_get_n_args (Command *self) { + guint result = 0U; + result = (guint) string_get_length ((*self).args_desc); + return result; +} + + +void command_copy (const Command* self, Command* dest) { + dest->name = g_strdup (self->name); + dest->description = g_strdup (self->description); + dest->args_desc = g_strdup (self->args_desc); + dest->function = self->function; +} + + +void command_destroy (Command* self) { + _g_free0 (self->name); + _g_free0 (self->description); + _g_free0 (self->args_desc); +} + + +Command* command_dup (const Command* self) { + Command* dup; + dup = g_new0 (Command, 1); + command_copy (self, dup); + return dup; +} + + +void command_free (Command* self) { + command_destroy (self); + g_free (self); +} + + +GType command_get_type (void) { + static volatile gsize command_type_id__volatile = 0; + if (g_once_init_enter (&command_type_id__volatile)) { + GType command_type_id; + command_type_id = g_boxed_type_register_static ("Command", (GBoxedCopyFunc) command_dup, (GBoxedFreeFunc) command_free); + g_once_init_leave (&command_type_id__volatile, command_type_id); + } + return command_type_id__volatile; +} + + + + diff --git a/ivi/gst-auto-launch/src/command.vala b/ivi/gst-auto-launch/src/command.vala new file mode 100755 index 0000000..3335a5c --- /dev/null +++ b/ivi/gst-auto-launch/src/command.vala @@ -0,0 +1,21 @@ +[CCode (has_target=false)] +delegate int CommandFunc(AutoPipeline auto_pipeline, Task task); + + +struct Command { + string name; + string description; + string args_desc; + CommandFunc function; + + public char get_arg_desc(uint arg_i) { + if(arg_i >= args_desc.length) + return 0; + return (char)args_desc[arg_i]; + } + + public uint get_n_args() { + return (uint)args_desc.length; + } +} + diff --git a/ivi/gst-auto-launch/src/commands.c b/ivi/gst-auto-launch/src/commands.c new file mode 100755 index 0000000..3643600 --- /dev/null +++ b/ivi/gst-auto-launch/src/commands.c @@ -0,0 +1,500 @@ +/* commands.c generated by valac 0.10.0, the Vala compiler + * generated from commands.vala, do not modify */ + + +#include +#include +#include +#include +#include +#include +#include + + +#define TYPE_COMMAND (command_get_type ()) + +#define TYPE_AUTO_PIPELINE (auto_pipeline_get_type ()) +#define AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTO_PIPELINE, AutoPipeline)) +#define AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTO_PIPELINE, AutoPipelineClass)) +#define IS_AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTO_PIPELINE)) +#define IS_AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTO_PIPELINE)) +#define AUTO_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTO_PIPELINE, AutoPipelineClass)) + +typedef struct _AutoPipeline AutoPipeline; +typedef struct _AutoPipelineClass AutoPipelineClass; + +#define TYPE_TASK (task_get_type ()) +#define TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK, Task)) +#define TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK, TaskClass)) +#define IS_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK)) +#define IS_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK)) +#define TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASK, TaskClass)) + +typedef struct _Task Task; +typedef struct _TaskClass TaskClass; +typedef struct _Command Command; +#define _gst_object_unref0(var) ((var == NULL) ? NULL : (var = (gst_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _gst_event_unref0(var) ((var == NULL) ? NULL : (var = (gst_event_unref (var), NULL))) + +typedef gint (*CommandFunc) (AutoPipeline* auto_pipeline, Task* task); +struct _Command { + char* name; + char* description; + char* args_desc; + CommandFunc function; +}; + + + +GType command_get_type (void) G_GNUC_CONST; +GType auto_pipeline_get_type (void) G_GNUC_CONST; +GType task_get_type (void) G_GNUC_CONST; +Command* command_dup (const Command* self); +void command_free (Command* self); +void command_copy (const Command* self, Command* dest); +void command_destroy (Command* self); +gint command_play (AutoPipeline* auto_pipeline, Task* task); +static gint _command_play_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_pause (AutoPipeline* auto_pipeline, Task* task); +static gint _command_pause_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_ready (AutoPipeline* auto_pipeline, Task* task); +static gint _command_ready_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_null (AutoPipeline* auto_pipeline, Task* task); +static gint _command_null_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_eos (AutoPipeline* auto_pipeline, Task* task); +static gint _command_eos_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_quit (AutoPipeline* auto_pipeline, Task* task); +static gint _command_quit_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_set (AutoPipeline* auto_pipeline, Task* task); +static gint _command_set_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_seek (AutoPipeline* auto_pipeline, Task* task); +static gint _command_seek_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_navigation (AutoPipeline* auto_pipeline, Task* task); +static gint _command_navigation_command_func (AutoPipeline* auto_pipeline, Task* task); +gint command_emit (AutoPipeline* auto_pipeline, Task* task); +static gint _command_emit_command_func (AutoPipeline* auto_pipeline, Task* task); +gboolean auto_pipeline_set_state (AutoPipeline* self, GstState state); +GValueArray* task_get_arguments (Task* self); +GstElement* auto_pipeline_get_by_name (AutoPipeline* self, const char* name); +GstBin* auto_pipeline_get_pipeline (AutoPipeline* self); +gboolean auto_pipeline_send_eos (AutoPipeline* self); +void scanner_register_symbols (GScanner* scanner); +static int _vala_strcmp0 (const char * str1, const char * str2); + +const Command COMMANDS[12] = {{"play", "Change pipeline state to PLAYING", "", _command_play_command_func}, {"pause", "Change pipeline state to PAUSED", "", _command_pause_command_func}, {"ready", "Change pipeline state to READY", "", _command_ready_command_func}, {"stop", "Change pipeline state to READY", "", _command_ready_command_func}, {"null", "Change pipeline state to NULL", "", _command_null_command_func}, {"eos", "Send eos to the source elements", "", _command_eos_command_func}, {"quit", "Quit the event loop", "", _command_quit_command_func}, {"set", "Set properties of an object", "ssv", _command_set_command_func}, {"seek", "Seek to the specified time", "t", _command_seek_command_func}, {"navigation", "Send the specified navigation event name to an element in the given co" \ +"ords", "ssii", _command_navigation_command_func}, {"emit", "Emit a signal to an element", "ss", _command_emit_command_func}, {NULL}}; + + +static gint _command_play_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_play (auto_pipeline, task); + return result; +} + + +static gint _command_pause_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_pause (auto_pipeline, task); + return result; +} + + +static gint _command_ready_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_ready (auto_pipeline, task); + return result; +} + + +static gint _command_null_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_null (auto_pipeline, task); + return result; +} + + +static gint _command_eos_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_eos (auto_pipeline, task); + return result; +} + + +static gint _command_quit_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_quit (auto_pipeline, task); + return result; +} + + +static gint _command_set_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_set (auto_pipeline, task); + return result; +} + + +static gint _command_seek_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_seek (auto_pipeline, task); + return result; +} + + +static gint _command_navigation_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_navigation (auto_pipeline, task); + return result; +} + + +static gint _command_emit_command_func (AutoPipeline* auto_pipeline, Task* task) { + gint result; + result = command_emit (auto_pipeline, task); + return result; +} + + +gint command_play (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + gint _tmp0_ = 0; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + g_print ("Passing to PLAYING\n"); + if (auto_pipeline_set_state (auto_pipeline, GST_STATE_PLAYING)) { + _tmp0_ = 0; + } else { + _tmp0_ = 1; + } + result = _tmp0_; + return result; +} + + +gint command_pause (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + gint _tmp0_ = 0; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + g_print ("Passing to PAUSED\n"); + if (auto_pipeline_set_state (auto_pipeline, GST_STATE_PAUSED)) { + _tmp0_ = 0; + } else { + _tmp0_ = 1; + } + result = _tmp0_; + return result; +} + + +gint command_ready (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + gint _tmp0_ = 0; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + g_print ("Passing to READY\n"); + if (auto_pipeline_set_state (auto_pipeline, GST_STATE_READY)) { + _tmp0_ = 0; + } else { + _tmp0_ = 1; + } + result = _tmp0_; + return result; +} + + +gint command_null (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + gint _tmp0_ = 0; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + g_print ("Passing to NULL\n"); + if (auto_pipeline_set_state (auto_pipeline, GST_STATE_NULL)) { + _tmp0_ = 0; + } else { + _tmp0_ = 1; + } + result = _tmp0_; + return result; +} + + +gint command_quit (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + g_print ("Quitting\n"); + g_signal_emit_by_name (auto_pipeline, "quit"); + result = 0; + return result; +} + + +gint command_set (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + GValue _tmp0_; + char* element_name; + GstElement* element; + GValue _tmp1_; + char* prop_name; + GParamSpec* prop_spec; + GType prop_type; + GValue prop_value; + GValue string_value = {0}; + char* value_as_string; + GValue converted_value = {0}; + char* _tmp3_; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + element_name = g_strdup (g_value_get_string ((_tmp0_ = task_get_arguments (task)->values[0], &_tmp0_))); + element = auto_pipeline_get_by_name (auto_pipeline, element_name); + if (element == NULL) { + g_printerr ("No element named '%s'\n", element_name); + result = 1; + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; + } + prop_name = g_strdup (g_value_get_string ((_tmp1_ = task_get_arguments (task)->values[1], &_tmp1_))); + prop_spec = g_object_class_find_property (G_OBJECT_GET_CLASS ((GObject*) element), prop_name); + if (prop_spec == NULL) { + g_printerr ("No property '%s' in element '%s'\n", prop_name, element_name); + result = 1; + _g_free0 (prop_name); + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; + } + prop_type = prop_spec->value_type; + prop_value = task_get_arguments (task)->values[2]; + if (G_VALUE_HOLDS (&prop_value, G_TYPE_STRING)) { + char* prop_string; + prop_string = g_strdup (g_value_get_string (&prop_value)); + if (G_TYPE_IS_ENUM (prop_type)) { + GEnumClass* enum_class; + GEnumValue* enum_value; + enum_class = (GEnumClass*) g_type_class_peek (prop_type); + enum_value = g_enum_get_value_by_nick (enum_class, prop_string); + if (enum_value != NULL) { + GValue _tmp2_ = {0}; + prop_value = (g_value_init (&_tmp2_, G_TYPE_INT), g_value_set_int (&_tmp2_, enum_value->value), _tmp2_); + G_IS_VALUE (&_tmp2_) ? (g_value_unset (&_tmp2_), NULL) : NULL; + } else { + g_printerr ("'%s' is not a valid value for enum '%s'\n", prop_string, g_type_name (prop_type)); + result = 1; + _g_free0 (prop_string); + _g_free0 (prop_name); + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; + } + } + _g_free0 (prop_string); + } + g_value_init (&string_value, G_TYPE_STRING); + g_value_transform (&prop_value, &string_value); + value_as_string = g_strdup (g_value_get_string (&string_value)); + g_value_init (&converted_value, prop_type); + if (!g_param_value_convert (prop_spec, &prop_value, &converted_value, TRUE)) { + g_print ("'%s' is not a valid value for property '%s' of type '%s'\n", value_as_string, prop_name, g_type_name (prop_type)); + result = 1; + G_IS_VALUE (&converted_value) ? (g_value_unset (&converted_value), NULL) : NULL; + _g_free0 (value_as_string); + G_IS_VALUE (&string_value) ? (g_value_unset (&string_value), NULL) : NULL; + _g_free0 (prop_name); + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; + } + g_print ("Setting property '%s' of element '%s' to '%s'\n", prop_name, _tmp3_ = gst_object_get_name ((GstObject*) element), value_as_string); + _g_free0 (_tmp3_); + g_object_set_property ((GObject*) element, prop_name, &converted_value); + result = 0; + G_IS_VALUE (&converted_value) ? (g_value_unset (&converted_value), NULL) : NULL; + _g_free0 (value_as_string); + G_IS_VALUE (&string_value) ? (g_value_unset (&string_value), NULL) : NULL; + _g_free0 (prop_name); + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; +} + + +static gpointer _gst_event_ref0 (gpointer self) { + return self ? gst_event_ref (self) : NULL; +} + + +gint command_seek (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + GValue position_value = {0}; + GValue _tmp0_; + double position_seconds; + gint64 position_useconds; + GstEvent* seek_event; + gint _tmp1_ = 0; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + g_value_init (&position_value, G_TYPE_DOUBLE); + g_value_transform ((_tmp0_ = task_get_arguments (task)->values[0], &_tmp0_), &position_value); + position_seconds = g_value_get_double (&position_value); + position_useconds = (gint64) (position_seconds * GST_SECOND); + seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, GST_SEEK_TYPE_SET, position_useconds, GST_SEEK_TYPE_NONE, (gint64) 0); + g_print ("Seeking to second %lf\n", position_seconds); + if (gst_element_send_event ((GstElement*) auto_pipeline_get_pipeline (auto_pipeline), _gst_event_ref0 (seek_event))) { + _tmp1_ = 0; + } else { + _tmp1_ = 1; + } + result = _tmp1_; + _gst_event_unref0 (seek_event); + G_IS_VALUE (&position_value) ? (g_value_unset (&position_value), NULL) : NULL; + return result; +} + + +gint command_eos (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + gint _tmp0_ = 0; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + if (auto_pipeline_send_eos (auto_pipeline)) { + _tmp0_ = 0; + } else { + _tmp0_ = 1; + } + result = _tmp0_; + return result; +} + + +gint command_navigation (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + GValue _tmp0_; + char* element_name; + GValue _tmp1_; + char* event_name; + GValue _tmp2_; + gint pointer_x; + GValue _tmp3_; + gint pointer_y; + gint _tmp4_ = 0; + gint button; + GstElement* element; + GstPad* src_pad; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + element_name = g_strdup (g_value_get_string ((_tmp0_ = task_get_arguments (task)->values[0], &_tmp0_))); + event_name = g_strdup (g_value_get_string ((_tmp1_ = task_get_arguments (task)->values[1], &_tmp1_))); + pointer_x = g_value_get_int ((_tmp2_ = task_get_arguments (task)->values[2], &_tmp2_)); + pointer_y = g_value_get_int ((_tmp3_ = task_get_arguments (task)->values[3], &_tmp3_)); + if (_vala_strcmp0 (event_name, "mouse-move") != 0) { + _tmp4_ = 1; + } else { + _tmp4_ = 0; + } + button = _tmp4_; + element = auto_pipeline_get_by_name (auto_pipeline, element_name); + if (element == NULL) { + g_printerr ("No element named '%s'\n", element_name); + result = 1; + _gst_object_unref0 (element); + _g_free0 (event_name); + _g_free0 (element_name); + return result; + } + src_pad = gst_element_get_static_pad (element, "src"); + if (src_pad == NULL) { + g_printerr ("No src pad in element %s", element_name); + result = 1; + _gst_object_unref0 (src_pad); + _gst_object_unref0 (element); + _g_free0 (event_name); + _g_free0 (element_name); + return result; + } + gst_pad_send_event (src_pad, gst_event_new_navigation (gst_structure_new ("application/x-gst-navigation", "event", G_TYPE_STRING, event_name, "button", G_TYPE_INT, button, "pointer_x", G_TYPE_DOUBLE, (double) pointer_x, "pointer_y", G_TYPE_DOUBLE, (double) pointer_y, NULL, NULL))); + result = 0; + _gst_object_unref0 (src_pad); + _gst_object_unref0 (element); + _g_free0 (event_name); + _g_free0 (element_name); + return result; +} + + +gint command_emit (AutoPipeline* auto_pipeline, Task* task) { + gint result = 0; + GValue _tmp0_; + char* element_name; + GstElement* element; + GValue _tmp1_; + char* signal_name; + guint signal_id; + g_return_val_if_fail (auto_pipeline != NULL, 0); + g_return_val_if_fail (task != NULL, 0); + element_name = g_strdup (g_value_get_string ((_tmp0_ = task_get_arguments (task)->values[0], &_tmp0_))); + element = auto_pipeline_get_by_name (auto_pipeline, element_name); + if (element == NULL) { + g_printerr ("No element named '%s'\n", element_name); + result = 1; + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; + } + signal_name = g_strdup (g_value_get_string ((_tmp1_ = task_get_arguments (task)->values[1], &_tmp1_))); + signal_id = g_signal_lookup (signal_name, G_TYPE_FROM_CLASS ((GTypeClass*) G_OBJECT_GET_CLASS ((GObject*) element))); + if (signal_id == 0) { + g_printerr ("No signal '%s' in element '%s'\n", signal_name, element_name); + result = 1; + _g_free0 (signal_name); + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; + } + g_signal_emit (element, signal_id, (GQuark) 0, NULL); + result = 0; + _g_free0 (signal_name); + _gst_object_unref0 (element); + _g_free0 (element_name); + return result; +} + + +void scanner_register_symbols (GScanner* scanner) { + g_return_if_fail (scanner != NULL); + { + gint i; + i = 0; + { + gboolean _tmp0_; + _tmp0_ = TRUE; + while (TRUE) { + if (!_tmp0_) { + i++; + } + _tmp0_ = FALSE; + if (!(COMMANDS[i].name != NULL)) { + break; + } + g_scanner_scope_add_symbol (scanner, 0U, COMMANDS[i].name, &COMMANDS[i]); + } + } + } +} + + +static int _vala_strcmp0 (const char * str1, const char * str2) { + if (str1 == NULL) { + return -(str1 != str2); + } + if (str2 == NULL) { + return str1 != str2; + } + return strcmp (str1, str2); +} + + + + diff --git a/ivi/gst-auto-launch/src/commands.vala b/ivi/gst-auto-launch/src/commands.vala new file mode 100755 index 0000000..8ff1a54 --- /dev/null +++ b/ivi/gst-auto-launch/src/commands.vala @@ -0,0 +1,182 @@ +const Command[] COMMANDS = { + {"play", "Change pipeline state to PLAYING", "", command_play}, + {"pause", "Change pipeline state to PAUSED", "", command_pause}, + {"ready", "Change pipeline state to READY", "", command_ready}, + {"stop", "Change pipeline state to READY", "", command_ready}, + {"null", "Change pipeline state to NULL", "", command_null}, + {"eos", "Send eos to the source elements", "", command_eos}, + {"quit", "Quit the event loop", "", command_quit}, + {"set", "Set properties of an object", "ssv", command_set}, + {"seek", "Seek to the specified time", "t", command_seek}, + {"navigation", "Send the specified navigation event name to an element in the given coords", "ssii", command_navigation}, + {"emit", "Emit a signal to an element", "ss", command_emit}, + {null} +}; + + +int command_play(AutoPipeline auto_pipeline, Task task) { + print("Passing to PLAYING\n"); + return auto_pipeline.set_state(Gst.State.PLAYING) ? 0 : 1; +} + + +int command_pause(AutoPipeline auto_pipeline, Task task) { + print("Passing to PAUSED\n"); + return auto_pipeline.set_state(Gst.State.PAUSED) ? 0 : 1; +} + + +int command_ready(AutoPipeline auto_pipeline, Task task) { + print("Passing to READY\n"); + return auto_pipeline.set_state(Gst.State.READY) ? 0 : 1; +} + + +int command_null(AutoPipeline auto_pipeline, Task task) { + print("Passing to NULL\n"); + return auto_pipeline.set_state(Gst.State.NULL) ? 0 : 1; +} + + +int command_quit(AutoPipeline auto_pipeline, Task task) { + print("Quitting\n"); + auto_pipeline.quit(); + return 0; +} + + +int command_set(AutoPipeline auto_pipeline, Task task) { + string element_name = task.arguments.values[0].get_string(); + + Gst.Element? element = auto_pipeline.get_by_name(element_name); + if(element == null) { + printerr("No element named '%s'\n", element_name); + return 1; + } + + string prop_name = task.arguments.values[1].get_string(); + weak ParamSpec? prop_spec = element.get_class().find_property(prop_name); + + if(prop_spec == null) { + printerr("No property '%s' in element '%s'\n", prop_name, element_name); + return 1; + } + Type prop_type = prop_spec.value_type; + + weak Value prop_value = task.arguments.values[2]; + if(prop_value.holds(typeof(string))) { + string prop_string = prop_value.get_string(); + if(prop_type.is_enum()) { + weak EnumClass enum_class = (EnumClass)prop_type.class_peek(); + weak EnumValue? enum_value = enum_class.get_value_by_nick(prop_string); + if(enum_value != null) + prop_value = enum_value.value; + else { + printerr("'%s' is not a valid value for enum '%s'\n", + prop_string, prop_type.name()); + return 1; + } + } + } + + Value string_value = Value(typeof(string)); + prop_value.transform(ref string_value); + string value_as_string = string_value.get_string(); + + Value converted_value = Value(prop_type); + + if(!prop_spec.value_convert(prop_value, converted_value, true)) { + print("'%s' is not a valid value for property '%s' of type '%s'\n", + value_as_string, prop_name, prop_type.name()); + return 1; + } + + print("Setting property '%s' of element '%s' to '%s'\n", + prop_name, element.get_name(), value_as_string); + + element.set_property(prop_name, converted_value); + return 0; +} + + +int command_seek(AutoPipeline auto_pipeline, Task task) { + Value position_value = Value(typeof(double)); + task.arguments.values[0].transform(ref position_value); + double position_seconds = position_value.get_double(); + int64 position_useconds = (int64)(position_seconds * Gst.SECOND); + + Gst.Event seek_event = + new Gst.Event.seek( + 1.0, Gst.Format.TIME, + Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT, + Gst.SeekType.SET, position_useconds, + Gst.SeekType.NONE, 0); + + print("Seeking to second %lf\n", position_seconds); + return auto_pipeline.pipeline.send_event(seek_event) ? 0 : 1; +} + + +int command_eos(AutoPipeline auto_pipeline, Task task) { + return auto_pipeline.send_eos() ? 0 : 1; +} + + +int command_navigation(AutoPipeline auto_pipeline, Task task) { + string element_name = task.arguments.values[0].get_string(); + string event_name = task.arguments.values[1].get_string(); + int pointer_x = task.arguments.values[2].get_int(); + int pointer_y = task.arguments.values[3].get_int(); + int button = (event_name != "mouse-move") ? 1 : 0; + + Gst.Element? element = auto_pipeline.get_by_name(element_name); + if(element == null) { + printerr("No element named '%s'\n", element_name); + return 1; + } + + Gst.Pad src_pad = element.get_static_pad("src"); + if(src_pad == null) { + printerr("No src pad in element %s", element_name); + return 1; + } + + src_pad.send_event( + new Gst.Event.navigation( + new Gst.Structure("application/x-gst-navigation", + "event", typeof(string), event_name, + "button", typeof(int), button, + "pointer_x", typeof(double), (double)pointer_x, + "pointer_y", typeof(double), (double)pointer_y, + null))); + return 0; +} + + +int command_emit(AutoPipeline auto_pipeline, Task task) { + string element_name = task.arguments.values[0].get_string(); + + Gst.Element? element = auto_pipeline.get_by_name(element_name); + if(element == null) { + printerr("No element named '%s'\n", element_name); + return 1; + } + + string signal_name = task.arguments.values[1].get_string(); + uint signal_id = Signal.lookup(signal_name, element.get_class().get_type()); + if(signal_id == 0) + { + printerr("No signal '%s' in element '%s'\n", signal_name, element_name); + return 1; + } + + Signal.emit(element, signal_id, 0); + return 0; +} + + +void scanner_register_symbols(Scanner scanner) { + for(int i=0; COMMANDS[i].name != null; i++) + scanner.scope_add_symbol(0U, COMMANDS[i].name, &COMMANDS[i]); +} + diff --git a/ivi/gst-auto-launch/src/gst-auto-launch.c b/ivi/gst-auto-launch/src/gst-auto-launch.c new file mode 100755 index 0000000..fa9ab10 --- /dev/null +++ b/ivi/gst-auto-launch/src/gst-auto-launch.c @@ -0,0 +1,501 @@ +/* gst-auto-launch.c generated by valac 0.10.0, the Vala compiler + * generated from gst-auto-launch.vala, do not modify */ + + +#include +#include +#include +#include +#include +#include +#include +#include + + +#define TYPE_AUTO_PIPELINE (auto_pipeline_get_type ()) +#define AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTO_PIPELINE, AutoPipeline)) +#define AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTO_PIPELINE, AutoPipelineClass)) +#define IS_AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTO_PIPELINE)) +#define IS_AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTO_PIPELINE)) +#define AUTO_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTO_PIPELINE, AutoPipelineClass)) + +typedef struct _AutoPipeline AutoPipeline; +typedef struct _AutoPipelineClass AutoPipelineClass; +#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define TYPE_TASK_SCANNER (task_scanner_get_type ()) +#define TASK_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK_SCANNER, TaskScanner)) +#define TASK_SCANNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK_SCANNER, TaskScannerClass)) +#define IS_TASK_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK_SCANNER)) +#define IS_TASK_SCANNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK_SCANNER)) +#define TASK_SCANNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASK_SCANNER, TaskScannerClass)) + +typedef struct _TaskScanner TaskScanner; +typedef struct _TaskScannerClass TaskScannerClass; +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define TYPE_TASK (task_get_type ()) +#define TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK, Task)) +#define TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK, TaskClass)) +#define IS_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK)) +#define IS_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK)) +#define TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASK, TaskClass)) + +typedef struct _Task Task; +typedef struct _TaskClass TaskClass; +#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL))) +#define __g_list_free_g_free0(var) ((var == NULL) ? NULL : (var = (_g_list_free_g_free (var), NULL))) +#define __g_list_free_g_object_unref0(var) ((var == NULL) ? NULL : (var = (_g_list_free_g_object_unref (var), NULL))) + +#define TYPE_COMMAND (command_get_type ()) +typedef struct _Command Command; +#define _gst_object_unref0(var) ((var == NULL) ? NULL : (var = (gst_object_unref (var), NULL))) +#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL))) + +typedef gint (*CommandFunc) (AutoPipeline* auto_pipeline, Task* task); +struct _Command { + char* name; + char* description; + char* args_desc; + CommandFunc function; +}; + + +extern gboolean output_messages; +gboolean output_messages = FALSE; +extern gboolean force_eos; +gboolean force_eos = FALSE; +extern guint how_many_control_c_pressed; +guint how_many_control_c_pressed = (guint) 0; +extern AutoPipeline* auto_pipeline; +AutoPipeline* auto_pipeline = NULL; + +GType auto_pipeline_get_type (void) G_GNUC_CONST; +void on_control_c (void); +gboolean auto_pipeline_send_eos (AutoPipeline* self); +gint _vala_main (char** args, int args_length1); +AutoPipeline* auto_pipeline_new (void); +AutoPipeline* auto_pipeline_construct (GType object_type); +static void _on_control_c_sighandler_t (gint signal); +#define LOG_FILENAME "gst-auto-launch.log" +void auto_pipeline_set_output_messages_enabled (AutoPipeline* self, gboolean value); +void auto_pipeline_log (AutoPipeline* self, const char* format, ...); +TaskScanner* task_scanner_new (void); +TaskScanner* task_scanner_construct (GType object_type); +GType task_scanner_get_type (void) G_GNUC_CONST; +void task_scanner_print_description (TaskScanner* self); +GType task_get_type (void) G_GNUC_CONST; +Task* task_scanner_get_task_from_arg (TaskScanner* self, const char* arg); +static void _g_list_free_g_free (GList* self); +static void _g_list_free_g_object_unref (GList* self); +GType command_get_type (void) G_GNUC_CONST; +Command* command_dup (const Command* self); +void command_free (Command* self); +void command_copy (const Command* self, Command* dest); +void command_destroy (Command* self); +Command* task_scanner_lookup_command (TaskScanner* self, const char* command_name); +Task* task_new (double seconds, Command* command); +Task* task_construct (GType object_type, double seconds, Command* command); +void auto_pipeline_set_pipeline (AutoPipeline* self, GstBin* value); +GstBin* auto_pipeline_get_pipeline (AutoPipeline* self); +guint task_exec (Task* self, AutoPipeline* auto_pipeline); +static void _g_main_loop_quit_auto_pipeline_quit (AutoPipeline* _sender, gpointer self); +gint auto_pipeline_get_return_status (AutoPipeline* self); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); +static gint _vala_array_length (gpointer array); + +const GOptionEntry options[3] = {{"gst-messages", 'm', 0, G_OPTION_ARG_NONE, &output_messages, "Output messages", NULL}, {"eos-on-shutdown", 'e', 0, G_OPTION_ARG_NONE, &force_eos, "Force EOS on sources before shutting the pipeline down", NULL}, {NULL}}; +static GRegex* _tmp9_regex_0 = NULL; + + +void on_control_c (void) { + if (auto_pipeline == NULL) { + return; + } + if (how_many_control_c_pressed == 0) { + auto_pipeline_send_eos (auto_pipeline); + } else { + g_signal_emit_by_name (auto_pipeline, "quit"); + } + how_many_control_c_pressed++; +} + + +static void _on_control_c_sighandler_t (gint signal) { + on_control_c (); +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static gboolean string_contains (const char* self, const char* needle) { + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (needle != NULL, FALSE); + result = strstr (self, needle) != NULL; + return result; +} + + +static inline GRegex* _thread_safe_regex_init (GRegex** re, const gchar * pattern, GRegexMatchFlags match_options) { + if (g_once_init_enter ((volatile gsize*) re)) { + GRegex* val = g_regex_new (pattern, match_options, 0, NULL); + g_once_init_leave ((volatile gsize*) re, (gsize) val); + } + return *re; +} + + +static gpointer _g_regex_ref0 (gpointer self) { + return self ? g_regex_ref (self) : NULL; +} + + +static void _g_list_free_g_free (GList* self) { + g_list_foreach (self, (GFunc) g_free, NULL); + g_list_free (self); +} + + +static void _g_list_free_g_object_unref (GList* self) { + g_list_foreach (self, (GFunc) g_object_unref, NULL); + g_list_free (self); +} + + +static void _g_main_loop_quit_auto_pipeline_quit (AutoPipeline* _sender, gpointer self) { + g_main_loop_quit (self); +} + + +gint _vala_main (char** args, int args_length1) { + gint result = 0; + GOptionContext* opt_context; + AutoPipeline* _tmp1_; + GTimeVal tv = {0}; + TaskScanner* scanner; + GList* tasks; + GList* effective_args_list; + gint i; + gint effective_args_length1; + gint _effective_args_size_; + char** _tmp11_; + gint _tmp10_; + char** effective_args; + char* _tmp13_; + char* pipeline_desc; + GMainLoop* loop; + GError * _inner_error_ = NULL; + opt_context = NULL; + { + GOptionContext* _tmp0_; + opt_context = (_tmp0_ = g_option_context_new ("- Build pipelines and run commands on them"), _g_option_context_free0 (opt_context), _tmp0_); + g_option_context_set_help_enabled (opt_context, TRUE); + g_option_context_add_main_entries (opt_context, options, "messages"); + g_option_context_add_group (opt_context, gst_init_get_option_group ()); + g_option_context_parse (opt_context, &args_length1, &args, &_inner_error_); + if (_inner_error_ != NULL) { + if (_inner_error_->domain == G_OPTION_ERROR) { + goto __catch0_g_option_error; + } + _g_option_context_free0 (opt_context); + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return 0; + } + } + goto __finally0; + __catch0_g_option_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { + g_printerr ("Option parsing failed: %s\n", e->message); + result = -1; + _g_error_free0 (e); + _g_option_context_free0 (opt_context); + return result; + } + } + __finally0: + if (_inner_error_ != NULL) { + _g_option_context_free0 (opt_context); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return 0; + } + auto_pipeline = (_tmp1_ = auto_pipeline_new (), _g_object_unref0 (auto_pipeline), _tmp1_); + if (force_eos) { + signal (SIGINT, _on_control_c_sighandler_t); + } + if (output_messages) { + g_printerr ("Logging message to '%s'\n", LOG_FILENAME); + auto_pipeline_set_output_messages_enabled (auto_pipeline, output_messages); + } + if (output_messages) { + GTimeVal _tmp2_ = {0}; + auto_pipeline_log (auto_pipeline, "{\n", NULL); + tv = (g_get_current_time (&_tmp2_), _tmp2_); + auto_pipeline_log (auto_pipeline, " 'start' : %6lu.%06lu,\n", tv.tv_sec, tv.tv_usec, NULL); + } + scanner = task_scanner_new (); + if (args_length1 < 2) { + char* _tmp3_; + g_printerr ("%s", _tmp3_ = g_option_context_get_help (opt_context, TRUE, NULL)); + _g_free0 (_tmp3_); + g_printerr ("Commands are of the form :\n"); + g_printerr ("Supported commands are:\n"); + task_scanner_print_description (scanner); + g_printerr ("\nExamples:\n"); + g_printerr (" %s videotestsrc ! autovideosink 0:pause 1:play +5:eos\n", args[0]); + g_printerr (" %s videotestsrc ! clockoverlay name=clock ! autovideosink 0:play 2:s" \ +"et:clock:valignment:bottom 5:eos\n", args[0]); + result = 1; + _g_object_unref0 (scanner); + _g_option_context_free0 (opt_context); + return result; + } + tasks = NULL; + effective_args_list = NULL; + { + gint _tmp4_; + char** _tmp5_ = NULL; + char** arg_collection; + int arg_collection_length1; + int arg_it; + arg_collection = (_tmp5_ = args + 1, _tmp4_ = args_length1 - 1, _tmp5_); + arg_collection_length1 = _tmp4_; + for (arg_it = 0; arg_it < _tmp4_; arg_it = arg_it + 1) { + char* arg; + arg = g_strdup (arg_collection[arg_it]); + { + Task* task; + task = task_scanner_get_task_from_arg (scanner, arg); + if (task != NULL) { + tasks = g_list_append (tasks, _g_object_ref0 (task)); + } else { + if (!g_str_has_prefix (arg, "--")) { + gboolean _tmp6_ = FALSE; + if (string_contains (arg, " ")) { + _tmp6_ = string_contains (arg, "="); + } else { + _tmp6_ = FALSE; + } + if (_tmp6_) { + gint parts_length1; + gint _parts_size_; + char** _tmp8_; + char** _tmp7_; + char** parts; + GRegex* _tmp9_; + GRegex* prop_name_regex; + parts = (_tmp8_ = _tmp7_ = g_strsplit (arg, "=", 2), parts_length1 = _vala_array_length (_tmp7_), _parts_size_ = parts_length1, _tmp8_); + prop_name_regex = _g_regex_ref0 (_thread_safe_regex_init (&_tmp9_regex_0, "^[A-Za-z][a-zA-Z0-9_-]+$", 0)); + if (g_regex_match (prop_name_regex, parts[0], 0, NULL)) { + char* new_arg; + new_arg = g_strdup_printf ("%s=\"%s\"", parts[0], parts[1]); + effective_args_list = g_list_append (effective_args_list, g_strdup (new_arg)); + _g_free0 (new_arg); + _g_regex_unref0 (prop_name_regex); + parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL); + _g_object_unref0 (task); + _g_free0 (arg); + continue; + } + _g_regex_unref0 (prop_name_regex); + parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL); + } + effective_args_list = g_list_append (effective_args_list, g_strdup (arg)); + } else { + result = 1; + _g_object_unref0 (task); + _g_free0 (arg); + __g_list_free_g_free0 (effective_args_list); + __g_list_free_g_object_unref0 (tasks); + _g_object_unref0 (scanner); + _g_option_context_free0 (opt_context); + return result; + } + } + _g_object_unref0 (task); + _g_free0 (arg); + } + } + } + if (g_list_length (tasks) == 0) { + char* auto_symbol; + Command* auto_command; + auto_symbol = g_strdup ("play"); + g_printerr ("No commands given, will exec '%s' automatically\n", auto_symbol); + auto_command = task_scanner_lookup_command (scanner, auto_symbol); + if (auto_command != NULL) { + Task* auto_task; + auto_task = task_new ((double) 0, auto_command); + tasks = g_list_append (tasks, _g_object_ref0 (auto_task)); + _g_object_unref0 (auto_task); + } else { + g_printerr ("Could not find a command named '%s'\n", auto_symbol); + } + _g_free0 (auto_symbol); + } + i = 0; + effective_args = (_tmp11_ = g_new0 (char*, (_tmp10_ = g_list_length (effective_args_list) + 1) + 1), effective_args_length1 = _tmp10_, _effective_args_size_ = effective_args_length1, _tmp11_); + { + GList* arg_collection; + GList* arg_it; + arg_collection = effective_args_list; + for (arg_it = arg_collection; arg_it != NULL; arg_it = arg_it->next) { + char* arg; + arg = g_strdup ((const char*) arg_it->data); + { + char* _tmp12_; + effective_args[i] = (_tmp12_ = g_strdup (arg), _g_free0 (effective_args[i]), _tmp12_); + i++; + _g_free0 (arg); + } + } + } + effective_args[i] = (_tmp13_ = NULL, _g_free0 (effective_args[i]), _tmp13_); + pipeline_desc = g_strjoinv (" ", effective_args); + { + GstElement* _tmp15_; + GstElement* _tmp16_; + GstBin* _tmp17_; + if (output_messages) { + GTimeVal _tmp14_ = {0}; + tv = (g_get_current_time (&_tmp14_), _tmp14_); + auto_pipeline_log (auto_pipeline, " 'description' : '%s',\n", pipeline_desc, NULL); + } + _tmp15_ = gst_parse_launch (pipeline_desc, &_inner_error_); + if (_inner_error_ != NULL) { + goto __catch1_g_error; + } + auto_pipeline_set_pipeline (auto_pipeline, _tmp17_ = (_tmp16_ = _tmp15_, GST_IS_BIN (_tmp16_) ? ((GstBin*) _tmp16_) : NULL)); + _gst_object_unref0 (_tmp17_); + if (output_messages) { + GTimeVal _tmp18_ = {0}; + tv = (g_get_current_time (&_tmp18_), _tmp18_); + auto_pipeline_log (auto_pipeline, " 'launch' : %6lu.%06lu,\n", tv.tv_sec, tv.tv_usec, NULL); + } + } + goto __finally1; + __catch1_g_error: + { + GError * e; + e = _inner_error_; + _inner_error_ = NULL; + { + g_printerr ("Error: %s\n", e->message); + if (auto_pipeline_get_pipeline (auto_pipeline) != NULL) { + gst_element_set_state ((GstElement*) auto_pipeline_get_pipeline (auto_pipeline), GST_STATE_NULL); + } + result = 1; + _g_error_free0 (e); + _g_free0 (pipeline_desc); + effective_args = (_vala_array_free (effective_args, effective_args_length1, (GDestroyNotify) g_free), NULL); + __g_list_free_g_free0 (effective_args_list); + __g_list_free_g_object_unref0 (tasks); + _g_object_unref0 (scanner); + _g_option_context_free0 (opt_context); + return result; + } + } + __finally1: + if (_inner_error_ != NULL) { + _g_free0 (pipeline_desc); + effective_args = (_vala_array_free (effective_args, effective_args_length1, (GDestroyNotify) g_free), NULL); + __g_list_free_g_free0 (effective_args_list); + __g_list_free_g_object_unref0 (tasks); + _g_object_unref0 (scanner); + _g_option_context_free0 (opt_context); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return 0; + } + { + GList* task_collection; + GList* task_it; + task_collection = tasks; + for (task_it = task_collection; task_it != NULL; task_it = task_it->next) { + Task* task; + task = _g_object_ref0 ((Task*) task_it->data); + { + task_exec (task, auto_pipeline); + _g_object_unref0 (task); + } + } + } + loop = g_main_loop_new (NULL, FALSE); + g_signal_connect (auto_pipeline, "quit", (GCallback) _g_main_loop_quit_auto_pipeline_quit, loop); + if (output_messages) { + auto_pipeline_log (auto_pipeline, " 'message' : [\n", NULL); + } + g_main_loop_run (loop); + if (output_messages) { + auto_pipeline_log (auto_pipeline, " ],\n", NULL); + } + gst_element_set_state ((GstElement*) auto_pipeline_get_pipeline (auto_pipeline), GST_STATE_NULL); + if (output_messages) { + GTimeVal _tmp19_ = {0}; + tv = (g_get_current_time (&_tmp19_), _tmp19_); + auto_pipeline_log (auto_pipeline, " 'end' : %6lu.%06lu,\n", tv.tv_sec, tv.tv_usec, NULL); + auto_pipeline_log (auto_pipeline, "}\n", NULL); + } + result = auto_pipeline_get_return_status (auto_pipeline); + _g_main_loop_unref0 (loop); + _g_free0 (pipeline_desc); + effective_args = (_vala_array_free (effective_args, effective_args_length1, (GDestroyNotify) g_free), NULL); + __g_list_free_g_free0 (effective_args_list); + __g_list_free_g_object_unref0 (tasks); + _g_object_unref0 (scanner); + _g_option_context_free0 (opt_context); + return result; +} + + +int main (int argc, char ** argv) { + g_thread_init (NULL); + g_type_init (); + return _vala_main (argv, argc); +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + +static gint _vala_array_length (gpointer array) { + int length; + length = 0; + if (array) { + while (((gpointer*) array)[length]) { + length++; + } + } + return length; +} + + + + diff --git a/ivi/gst-auto-launch/src/gst-auto-launch.vala b/ivi/gst-auto-launch/src/gst-auto-launch.vala new file mode 100755 index 0000000..6a90e43 --- /dev/null +++ b/ivi/gst-auto-launch/src/gst-auto-launch.vala @@ -0,0 +1,156 @@ +bool output_messages; +bool force_eos; + +const OptionEntry[] options = { + { "gst-messages", 'm', 0, OptionArg.NONE, ref output_messages, "Output messages", null }, + { "eos-on-shutdown", 'e', 0, OptionArg.NONE, ref force_eos, "Force EOS on sources before shutting the pipeline down", null }, + {null} +}; + + +uint how_many_control_c_pressed = 0; +AutoPipeline auto_pipeline; + +void on_control_c() { + if(auto_pipeline == null) + return; + if(how_many_control_c_pressed == 0) + auto_pipeline.send_eos(); + else + auto_pipeline.quit(); + how_many_control_c_pressed++; +} + + +int main(string[] args) { + OptionContext opt_context; + try { + opt_context = new OptionContext("- Build pipelines and run commands on them"); + opt_context.set_help_enabled(true); + opt_context.add_main_entries(options, "messages"); + opt_context.add_group(Gst.init_get_option_group()); + opt_context.parse(ref args); + } + catch (OptionError e) { + printerr("Option parsing failed: %s\n", e.message); + return -1; + } + + auto_pipeline = new AutoPipeline(); + + if(force_eos) + Posix.signal(Posix.SIGINT, on_control_c); + + if(output_messages) { + printerr("Logging message to '%s'\n", LOG_FILENAME); + auto_pipeline.output_messages_enabled = output_messages; + } + + TimeVal tv; + + if(output_messages) { + auto_pipeline.log("{\n"); + tv = TimeVal(); + auto_pipeline.log(" 'start' : %6lu.%06lu,\n", tv.tv_sec, tv.tv_usec); + } + + TaskScanner scanner = new TaskScanner(); + + if(args.length < 2) { + printerr(opt_context.get_help(true, null)); + printerr("Commands are of the form :\n"); + printerr("Supported commands are:\n"); + + scanner.print_description(); + + printerr("\nExamples:\n"); + printerr(" %s videotestsrc ! autovideosink 0:pause 1:play +5:eos\n", args[0]); + printerr(" %s videotestsrc ! clockoverlay name=clock ! autovideosink 0:play 2:set:clock:valignment:bottom 5:eos\n", args[0]); + + return 1; + } + + List tasks = new List (); + List effective_args_list = new List (); + + foreach(string arg in args[1:args.length]) { + Task? task = scanner.get_task_from_arg(arg); + if(task != null) + tasks.append(task); + else if(!arg.has_prefix("--")) { + if(" " in arg && "=" in arg) { + string[] parts = arg.split("=", 2); + Regex prop_name_regex = /^[A-Za-z][a-zA-Z0-9_-]+$/; + if(prop_name_regex.match(parts[0])) { + string new_arg = "%s=\"%s\"".printf(parts[0],parts[1]); + effective_args_list.append(new_arg); + continue; + } + } + effective_args_list.append(arg); + } + else + return 1; + } + + if(tasks.length() == 0) { + string auto_symbol = "play"; + printerr("No commands given, will exec '%s' automatically\n", auto_symbol); + weak Command? auto_command = scanner.lookup_command(auto_symbol); + if(auto_command != null) { + Task auto_task = new Task(0, auto_command); + tasks.append(auto_task); + } + else + printerr("Could not find a command named '%s'\n", auto_symbol); + } + + int i = 0; + string[] effective_args = new string[effective_args_list.length()+1]; + foreach(string arg in effective_args_list) { + effective_args[i] = arg; + i++; + } + effective_args[i] = null; + string pipeline_desc = string.joinv(" ", effective_args); + + try { + if(output_messages) { + tv = TimeVal(); + auto_pipeline.log(" 'description' : '%s',\n", pipeline_desc); + } + auto_pipeline.pipeline = Gst.parse_launch(pipeline_desc) as Gst.Bin; + if(output_messages) { + tv = TimeVal(); + auto_pipeline.log(" 'launch' : %6lu.%06lu,\n", tv.tv_sec, tv.tv_usec); + } + + } + catch(Error e) { + printerr("Error: %s\n", e.message); + if(auto_pipeline.pipeline != null) + auto_pipeline.pipeline.set_state(Gst.State.NULL); + return 1; + } + + foreach(Task task in tasks) + task.exec(auto_pipeline); + + MainLoop loop = new MainLoop(); + auto_pipeline.quit.connect(loop.quit); + + if(output_messages) + auto_pipeline.log(" 'message' : [\n"); + loop.run(); + if(output_messages) + auto_pipeline.log(" ],\n"); + auto_pipeline.pipeline.set_state(Gst.State.NULL); + if(output_messages) { + tv = TimeVal(); + auto_pipeline.log(" 'end' : %6lu.%06lu,\n", tv.tv_sec, tv.tv_usec); + auto_pipeline.log("}\n"); + } + + return auto_pipeline.return_status; +} + diff --git a/ivi/gst-auto-launch/src/task-scanner.c b/ivi/gst-auto-launch/src/task-scanner.c new file mode 100755 index 0000000..0bbcb42 --- /dev/null +++ b/ivi/gst-auto-launch/src/task-scanner.c @@ -0,0 +1,468 @@ +/* task-scanner.c generated by valac 0.10.0, the Vala compiler + * generated from task-scanner.vala, do not modify */ + + +#include +#include +#include +#include +#include +#include + + +#define TYPE_TASK_SCANNER (task_scanner_get_type ()) +#define TASK_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK_SCANNER, TaskScanner)) +#define TASK_SCANNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK_SCANNER, TaskScannerClass)) +#define IS_TASK_SCANNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK_SCANNER)) +#define IS_TASK_SCANNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK_SCANNER)) +#define TASK_SCANNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASK_SCANNER, TaskScannerClass)) + +typedef struct _TaskScanner TaskScanner; +typedef struct _TaskScannerClass TaskScannerClass; +typedef struct _TaskScannerPrivate TaskScannerPrivate; +#define _g_scanner_destroy0(var) ((var == NULL) ? NULL : (var = (g_scanner_destroy (var), NULL))) + +#define TYPE_TASK (task_get_type ()) +#define TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK, Task)) +#define TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK, TaskClass)) +#define IS_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK)) +#define IS_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK)) +#define TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASK, TaskClass)) + +typedef struct _Task Task; +typedef struct _TaskClass TaskClass; + +#define TYPE_COMMAND (command_get_type ()) + +#define TYPE_AUTO_PIPELINE (auto_pipeline_get_type ()) +#define AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTO_PIPELINE, AutoPipeline)) +#define AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTO_PIPELINE, AutoPipelineClass)) +#define IS_AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTO_PIPELINE)) +#define IS_AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTO_PIPELINE)) +#define AUTO_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTO_PIPELINE, AutoPipelineClass)) + +typedef struct _AutoPipeline AutoPipeline; +typedef struct _AutoPipelineClass AutoPipelineClass; +typedef struct _Command Command; +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +struct _TaskScanner { + GObject parent_instance; + TaskScannerPrivate * priv; +}; + +struct _TaskScannerClass { + GObjectClass parent_class; +}; + +struct _TaskScannerPrivate { + GScanner* scanner; + double last_time_seconds; +}; + +typedef gint (*CommandFunc) (AutoPipeline* auto_pipeline, Task* task); +struct _Command { + char* name; + char* description; + char* args_desc; + CommandFunc function; +}; + + +static gpointer task_scanner_parent_class = NULL; + +GType task_scanner_get_type (void) G_GNUC_CONST; +#define TASK_SCANNER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TASK_SCANNER, TaskScannerPrivate)) +enum { + TASK_SCANNER_DUMMY_PROPERTY +}; +TaskScanner* task_scanner_new (void); +TaskScanner* task_scanner_construct (GType object_type); +void scanner_register_symbols (GScanner* scanner); +GType task_get_type (void) G_GNUC_CONST; +Task* task_scanner_get_task_from_arg (TaskScanner* self, const char* arg); +static double task_scanner_get_seconds (TaskScanner* self, GTokenType* last_token); +GType command_get_type (void) G_GNUC_CONST; +GType auto_pipeline_get_type (void) G_GNUC_CONST; +Command* command_dup (const Command* self); +void command_free (Command* self); +void command_copy (const Command* self, Command* dest); +void command_destroy (Command* self); +Task* task_new (double seconds, Command* command); +Task* task_construct (GType object_type, double seconds, Command* command); +gchar command_get_arg_desc (Command *self, guint arg_i); +GValueArray* task_get_arguments (Task* self); +static double task_scanner_get_signed_number (TaskScanner* self, GTokenType* last_token); +guint command_get_n_args (Command *self); +static double task_scanner_get_number (TaskScanner* self, GTokenType* last_token, gint* relative); +void task_scanner_print_description (TaskScanner* self); +static void _lambda2_ (void* key, void* val, TaskScanner* self); +static void __lambda2__gh_func (void* key, void* value, gpointer self); +Command* task_scanner_lookup_command (TaskScanner* self, const char* command_name); +static void task_scanner_finalize (GObject* obj); +static int _vala_strcmp0 (const char * str1, const char * str2); + + + +TaskScanner* task_scanner_construct (GType object_type) { + TaskScanner * self; + GScanner* _tmp0_; + self = (TaskScanner*) g_object_new (object_type, NULL); + self->priv->last_time_seconds = (double) 0; + self->priv->scanner = (_tmp0_ = g_scanner_new (NULL), _g_scanner_destroy0 (self->priv->scanner), _tmp0_); + (*self->priv->scanner->config).scan_identifier_1char = TRUE; + (*self->priv->scanner->config).identifier_2_string = TRUE; + scanner_register_symbols (self->priv->scanner); + (*self->priv->scanner->config).cset_identifier_nth = G_CSET_a_2_z G_CSET_A_2_Z " _-0123456789" G_CSET_LATINC G_CSET_LATINS; + return self; +} + + +TaskScanner* task_scanner_new (void) { + return task_scanner_construct (TYPE_TASK_SCANNER); +} + + +static gboolean string_contains (const char* self, const char* needle) { + gboolean result = FALSE; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (needle != NULL, FALSE); + result = strstr (self, needle) != NULL; + return result; +} + + +static glong string_get_length (const char* self) { + glong result; + g_return_val_if_fail (self != NULL, 0L); + result = g_utf8_strlen (self, (gssize) (-1)); + return result; +} + + +Task* task_scanner_get_task_from_arg (TaskScanner* self, const char* arg) { + Task* result = NULL; + GTokenType token = 0; + double number; + gboolean _tmp0_ = FALSE; + Command* command; + Task* task; + guint arg_n; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (arg != NULL, NULL); + if (!string_contains (arg, ":")) { + result = NULL; + return result; + } + g_scanner_input_text (self->priv->scanner, arg, (guint) string_get_length (arg)); + number = task_scanner_get_seconds (self, &token); + if (token != G_TOKEN_INT) { + _tmp0_ = token != G_TOKEN_FLOAT; + } else { + _tmp0_ = FALSE; + } + if (_tmp0_) { + result = NULL; + return result; + } + self->priv->last_time_seconds = number; + token = g_scanner_get_next_token (self->priv->scanner); + if (token != ':') { + g_printerr ("Expected ':' between seconds and command\n"); + result = NULL; + return result; + } + token = g_scanner_get_next_token (self->priv->scanner); + if (token != G_TOKEN_SYMBOL) { + g_printerr ("Expected a valid command\n"); + result = NULL; + return result; + } + command = (Command*) self->priv->scanner->value.v_symbol; + task = task_new (number, command); + arg_n = (guint) 0; + while (TRUE) { + gchar arg_desc; + if (!((token = g_scanner_get_next_token (self->priv->scanner)) == ':')) { + break; + } + arg_desc = command_get_arg_desc (command, arg_n); + token = g_scanner_peek_next_token (self->priv->scanner); + if (token == G_TOKEN_STRING) { + char* s; + g_scanner_get_next_token (self->priv->scanner); + s = g_strdup (self->priv->scanner->value.v_string); + if (_vala_strcmp0 (s, "true") == 0) { + GValue _tmp1_ = {0}; + GValue _tmp2_; + g_value_array_append (task_get_arguments (task), (_tmp2_ = (g_value_init (&_tmp1_, G_TYPE_BOOLEAN), g_value_set_boolean (&_tmp1_, TRUE), _tmp1_), &_tmp2_)); + G_IS_VALUE (&_tmp1_) ? (g_value_unset (&_tmp1_), NULL) : NULL; + } else { + if (_vala_strcmp0 (s, "false") == 0) { + GValue _tmp3_ = {0}; + GValue _tmp4_; + g_value_array_append (task_get_arguments (task), (_tmp4_ = (g_value_init (&_tmp3_, G_TYPE_BOOLEAN), g_value_set_boolean (&_tmp3_, FALSE), _tmp3_), &_tmp4_)); + G_IS_VALUE (&_tmp3_) ? (g_value_unset (&_tmp3_), NULL) : NULL; + } else { + GValue _tmp5_ = {0}; + GValue _tmp6_; + g_value_array_append (task_get_arguments (task), (_tmp6_ = (g_value_init (&_tmp5_, G_TYPE_STRING), g_value_set_string (&_tmp5_, s), _tmp5_), &_tmp6_)); + G_IS_VALUE (&_tmp5_) ? (g_value_unset (&_tmp5_), NULL) : NULL; + } + } + _g_free0 (s); + } else { + gboolean _tmp7_ = FALSE; + gboolean _tmp8_ = FALSE; + gboolean _tmp9_ = FALSE; + if (token == G_TOKEN_INT) { + _tmp9_ = TRUE; + } else { + _tmp9_ = token == G_TOKEN_FLOAT; + } + if (_tmp9_) { + _tmp8_ = TRUE; + } else { + _tmp8_ = token == '+'; + } + if (_tmp8_) { + _tmp7_ = TRUE; + } else { + _tmp7_ = token == '-'; + } + if (_tmp7_) { + if (arg_desc == 't') { + GValue _tmp10_ = {0}; + GValue _tmp11_; + number = task_scanner_get_seconds (self, &token); + g_value_array_append (task_get_arguments (task), (_tmp11_ = (g_value_init (&_tmp10_, G_TYPE_DOUBLE), g_value_set_double (&_tmp10_, (double) number), _tmp10_), &_tmp11_)); + G_IS_VALUE (&_tmp10_) ? (g_value_unset (&_tmp10_), NULL) : NULL; + } else { + number = task_scanner_get_signed_number (self, &token); + if (token == G_TOKEN_INT) { + GValue _tmp12_ = {0}; + GValue _tmp13_; + g_value_array_append (task_get_arguments (task), (_tmp13_ = (g_value_init (&_tmp12_, G_TYPE_INT), g_value_set_int (&_tmp12_, (gint) number), _tmp12_), &_tmp13_)); + G_IS_VALUE (&_tmp12_) ? (g_value_unset (&_tmp12_), NULL) : NULL; + } else { + if (token == G_TOKEN_FLOAT) { + GValue _tmp14_ = {0}; + GValue _tmp15_; + g_value_array_append (task_get_arguments (task), (_tmp15_ = (g_value_init (&_tmp14_, G_TYPE_DOUBLE), g_value_set_double (&_tmp14_, (double) number), _tmp14_), &_tmp15_)); + G_IS_VALUE (&_tmp14_) ? (g_value_unset (&_tmp14_), NULL) : NULL; + } + } + } + } + } + arg_n++; + } + if (command_get_n_args (command) != task_get_arguments (task)->n_values) { + g_printerr ("Command '%s' takes %u arguments (got %u)\n", (*command).name, command_get_n_args (command), task_get_arguments (task)->n_values); + result = NULL; + _g_object_unref0 (task); + return result; + } + { + guint arg_i; + arg_i = (guint) 0; + { + gboolean _tmp16_; + _tmp16_ = TRUE; + while (TRUE) { + gchar arg_desc; + GValue arg_value; + if (!_tmp16_) { + arg_i++; + } + _tmp16_ = FALSE; + if (!(arg_i < arg_n)) { + break; + } + arg_desc = command_get_arg_desc (command, arg_i); + arg_value = task_get_arguments (task)->values[arg_i]; + switch (arg_desc) { + case 's': + { + if (!G_VALUE_HOLDS (&arg_value, G_TYPE_STRING)) { + g_printerr ("Argument %u of '%s' must be a string\n", arg_i, (*command).name); + result = NULL; + _g_object_unref0 (task); + return result; + } + break; + } + case 'i': + { + if (!G_VALUE_HOLDS (&arg_value, G_TYPE_INT)) { + g_printerr ("Argument %u of '%s' must be an integer\n", arg_i, (*command).name); + result = NULL; + _g_object_unref0 (task); + return result; + } + break; + } + case 't': + { + if (!G_VALUE_HOLDS (&arg_value, G_TYPE_DOUBLE)) { + g_printerr ("Argument %u of '%s' must be in seconds\n", arg_i, (*command).name); + result = NULL; + _g_object_unref0 (task); + return result; + } + number = g_value_get_double (&arg_value); + if (number < 0.0) { + g_printerr ("Argument %u of '%s' cannot be negative\n", arg_i, (*command).name); + result = NULL; + _g_object_unref0 (task); + return result; + } + break; + } + } + } + } + } + result = task; + return result; +} + + +static double task_scanner_get_seconds (TaskScanner* self, GTokenType* last_token) { + double result = 0.0; + gint relative = 0; + double seconds; + g_return_val_if_fail (self != NULL, 0.0); + seconds = task_scanner_get_number (self, last_token, &relative); + if (relative != 0) { + seconds = seconds + (relative * self->priv->last_time_seconds); + } + result = seconds; + return result; +} + + +static double task_scanner_get_signed_number (TaskScanner* self, GTokenType* last_token) { + double result = 0.0; + gint relative = 0; + double number; + g_return_val_if_fail (self != NULL, 0.0); + number = task_scanner_get_number (self, last_token, &relative); + if (relative == (-1)) { + result = -number; + return result; + } + result = number; + return result; +} + + +static double task_scanner_get_number (TaskScanner* self, GTokenType* last_token, gint* relative) { + double result = 0.0; + double number = 0.0; + GTokenType token; + g_return_val_if_fail (self != NULL, 0.0); + token = g_scanner_get_next_token (self->priv->scanner); + if (token == '+') { + *relative = 1; + } else { + if (token == '-') { + *relative = -1; + } else { + *relative = 0; + } + } + if ((*relative) != 0) { + token = g_scanner_get_next_token (self->priv->scanner); + } + if (token == G_TOKEN_INT) { + number = (double) self->priv->scanner->value.v_int; + } else { + if (token == G_TOKEN_FLOAT) { + number = self->priv->scanner->value.v_float; + } else { + number = (double) 0; + } + } + *last_token = token; + result = number; + return result; +} + + +static void _lambda2_ (void* key, void* val, TaskScanner* self) { + char* name; + Command* command; + name = g_strdup ((const char*) key); + command = (Command*) val; + g_printerr (" %s:\n %s\n", name, (*command).description); + _g_free0 (name); +} + + +static void __lambda2__gh_func (void* key, void* value, gpointer self) { + _lambda2_ (key, value, self); +} + + +void task_scanner_print_description (TaskScanner* self) { + g_return_if_fail (self != NULL); + g_scanner_scope_foreach_symbol (self->priv->scanner, 0U, __lambda2__gh_func, self); +} + + +Command* task_scanner_lookup_command (TaskScanner* self, const char* command_name) { + Command* result = NULL; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (command_name != NULL, NULL); + result = (Command*) g_scanner_lookup_symbol (self->priv->scanner, command_name); + return result; +} + + +static void task_scanner_class_init (TaskScannerClass * klass) { + task_scanner_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (TaskScannerPrivate)); + G_OBJECT_CLASS (klass)->finalize = task_scanner_finalize; +} + + +static void task_scanner_instance_init (TaskScanner * self) { + self->priv = TASK_SCANNER_GET_PRIVATE (self); +} + + +static void task_scanner_finalize (GObject* obj) { + TaskScanner * self; + self = TASK_SCANNER (obj); + _g_scanner_destroy0 (self->priv->scanner); + G_OBJECT_CLASS (task_scanner_parent_class)->finalize (obj); +} + + +GType task_scanner_get_type (void) { + static volatile gsize task_scanner_type_id__volatile = 0; + if (g_once_init_enter (&task_scanner_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (TaskScannerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) task_scanner_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TaskScanner), 0, (GInstanceInitFunc) task_scanner_instance_init, NULL }; + GType task_scanner_type_id; + task_scanner_type_id = g_type_register_static (G_TYPE_OBJECT, "TaskScanner", &g_define_type_info, 0); + g_once_init_leave (&task_scanner_type_id__volatile, task_scanner_type_id); + } + return task_scanner_type_id__volatile; +} + + +static int _vala_strcmp0 (const char * str1, const char * str2) { + if (str1 == NULL) { + return -(str1 != str2); + } + if (str2 == NULL) { + return str1 != str2; + } + return strcmp (str1, str2); +} + + + + diff --git a/ivi/gst-auto-launch/src/task-scanner.vala b/ivi/gst-auto-launch/src/task-scanner.vala new file mode 100755 index 0000000..d3cf6cf --- /dev/null +++ b/ivi/gst-auto-launch/src/task-scanner.vala @@ -0,0 +1,186 @@ +class TaskScanner: Object { + Scanner scanner; + double last_time_seconds; + + + public TaskScanner() { + last_time_seconds = 0; + scanner = new Scanner(null); + scanner.config.scan_identifier_1char = true; + scanner.config.identifier_2_string = true; + scanner_register_symbols(scanner); + scanner.config.cset_identifier_nth = + CharacterSet.a_2_z + CharacterSet.A_2_Z + " _-0123456789" + + CharacterSet.LATINC + CharacterSet.LATINS; + } + + + public Task? get_task_from_arg(string arg) { + if(!arg.contains(":")) + return null; + scanner.input_text(arg, (uint)arg.length); + + TokenType token; + + double number = get_seconds(out token); + if(token != TokenType.INT && token != TokenType.FLOAT) + return null; + + last_time_seconds = number; + + token = scanner.get_next_token(); + if(token != ':') { + printerr("Expected ':' between seconds and command\n"); + return null; + } + + token = scanner.get_next_token(); + if(token != TokenType.SYMBOL) { + printerr("Expected a valid command\n"); + return null; + } + + weak Command? command = (Command?)scanner.value.symbol; + Task task = new Task(number, command); + + uint arg_n = 0; + while( (token = scanner.get_next_token()) == ':') { + char arg_desc = command.get_arg_desc(arg_n); + + token = scanner.peek_next_token(); + if(token == TokenType.STRING) { + scanner.get_next_token(); + string s = scanner.value.string; + if(s == "true") + task.arguments.append(true); + else if(s == "false") + task.arguments.append(false); + else + task.arguments.append(s); + } + else + if(token == TokenType.INT || token == TokenType.FLOAT || + token == '+' || token == '-') { + if(arg_desc == 't') { + number = get_seconds(out token); + task.arguments.append((double)number); + } + else { + number = get_signed_number(out token); + if(token == TokenType.INT) + task.arguments.append((int)number); + else + if(token == TokenType.FLOAT) + task.arguments.append((double)number); + } + } + arg_n++; + } + + if(command.get_n_args() != task.arguments.n_values) { + printerr("Command '%s' takes %u arguments (got %u)\n", + command.name, command.get_n_args(), task.arguments.n_values); + return null; + } + + for(uint arg_i = 0; arg_i < arg_n; arg_i++) { + char arg_desc = command.get_arg_desc(arg_i); + unowned Value arg_value = task.arguments.values[arg_i]; + switch(arg_desc) { + case 's': + if(!arg_value.holds(typeof(string))) { + printerr("Argument %u of '%s' must be a string\n", + arg_i, command.name); + return null; + } + break; + case 'i': + if(!arg_value.holds(typeof(int))) { + printerr("Argument %u of '%s' must be an integer\n", + arg_i, command.name); + return null; + } + break; + case 't': + if(!arg_value.holds(typeof(double))) { + printerr("Argument %u of '%s' must be in seconds\n", + arg_i, command.name); + return null; + } + number = arg_value.get_double(); + if(number < 0.0) { + printerr("Argument %u of '%s' cannot be negative\n", + arg_i, command.name); + return null; + } + break; + } + } + + return task; + } + + + double get_seconds(out TokenType last_token) { + int relative; + double seconds = get_number(out last_token, out relative); + + if(relative != 0) + seconds += relative * last_time_seconds; + + return seconds; + } + + + double get_signed_number(out TokenType last_token) { + int relative; + double number = get_number(out last_token, out relative); + + if(relative == -1) + return -number; + return number; + } + + + double get_number(out TokenType last_token, out int relative) { + double number; + TokenType token = scanner.get_next_token(); + + if(token == '+') + relative = 1; + else if(token == '-') + relative = -1; + else + relative = 0; + + if(relative != 0) + token = scanner.get_next_token(); + + if(token == TokenType.INT) + number = scanner.value.int; + else if(token == TokenType.FLOAT) + number = scanner.value.float; + else + number = 0; + + last_token = token; + return number; + } + + + public void print_description() { + scanner.scope_foreach_symbol(0U, + (key, val) => { + string name = (string)key; + weak Command? command = (Command?)val; + printerr(" %s:\n %s\n", name, command.description); + } + ); + } + + + public unowned Command? lookup_command(string command_name) { + return (Command?)scanner.lookup_symbol(command_name); + } +} + diff --git a/ivi/gst-auto-launch/src/task.c b/ivi/gst-auto-launch/src/task.c new file mode 100755 index 0000000..b684b1f --- /dev/null +++ b/ivi/gst-auto-launch/src/task.c @@ -0,0 +1,245 @@ +/* task.c generated by valac 0.10.0, the Vala compiler + * generated from task.vala, do not modify */ + + +#include +#include +#include +#include +#include +#include + + +#define TYPE_TASK (task_get_type ()) +#define TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TASK, Task)) +#define TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TASK, TaskClass)) +#define IS_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TASK)) +#define IS_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TASK)) +#define TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TASK, TaskClass)) + +typedef struct _Task Task; +typedef struct _TaskClass TaskClass; +typedef struct _TaskPrivate TaskPrivate; + +#define TYPE_COMMAND (command_get_type ()) + +#define TYPE_AUTO_PIPELINE (auto_pipeline_get_type ()) +#define AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTO_PIPELINE, AutoPipeline)) +#define AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTO_PIPELINE, AutoPipelineClass)) +#define IS_AUTO_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTO_PIPELINE)) +#define IS_AUTO_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTO_PIPELINE)) +#define AUTO_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTO_PIPELINE, AutoPipelineClass)) + +typedef struct _AutoPipeline AutoPipeline; +typedef struct _AutoPipelineClass AutoPipelineClass; +typedef struct _Command Command; +#define _g_value_array_free0(var) ((var == NULL) ? NULL : (var = (g_value_array_free (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +typedef struct _Block1Data Block1Data; + +struct _Task { + GObject parent_instance; + TaskPrivate * priv; +}; + +struct _TaskClass { + GObjectClass parent_class; +}; + +typedef gint (*CommandFunc) (AutoPipeline* auto_pipeline, Task* task); +struct _Command { + char* name; + char* description; + char* args_desc; + CommandFunc function; +}; + +struct _TaskPrivate { + double _seconds; + Command* _command; + GValueArray* _arguments; +}; + +struct _Block1Data { + int _ref_count_; + Task * self; + AutoPipeline* auto_pipeline; +}; + + +static gpointer task_parent_class = NULL; + +GType task_get_type (void) G_GNUC_CONST; +GType command_get_type (void) G_GNUC_CONST; +GType auto_pipeline_get_type (void) G_GNUC_CONST; +Command* command_dup (const Command* self); +void command_free (Command* self); +void command_copy (const Command* self, Command* dest); +void command_destroy (Command* self); +#define TASK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TASK, TaskPrivate)) +enum { + TASK_DUMMY_PROPERTY, + TASK_SECONDS, + TASK_ARGUMENTS +}; +Task* task_new (double seconds, Command* command); +Task* task_construct (GType object_type, double seconds, Command* command); +guint task_exec (Task* self, AutoPipeline* auto_pipeline); +double task_get_seconds (Task* self); +static gboolean _lambda1_ (Block1Data* _data1_); +gint auto_pipeline_get_return_status (AutoPipeline* self); +void auto_pipeline_set_return_status (AutoPipeline* self, gint value); +static gboolean __lambda1__gsource_func (gpointer self); +static Block1Data* block1_data_ref (Block1Data* _data1_); +static void block1_data_unref (Block1Data* _data1_); +GValueArray* task_get_arguments (Task* self); +static void task_finalize (GObject* obj); +static void task_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); + + + +Task* task_construct (GType object_type, double seconds, Command* command) { + Task * self; + GValueArray* _tmp0_; + self = (Task*) g_object_new (object_type, NULL); + self->priv->_seconds = seconds; + self->priv->_command = command; + self->priv->_arguments = (_tmp0_ = g_value_array_new ((guint) 0), _g_value_array_free0 (self->priv->_arguments), _tmp0_); + return self; +} + + +Task* task_new (double seconds, Command* command) { + return task_construct (TYPE_TASK, seconds, command); +} + + +static gboolean _lambda1_ (Block1Data* _data1_) { + Task * self; + gboolean result = FALSE; + self = _data1_->self; + if (auto_pipeline_get_return_status (_data1_->auto_pipeline) == 0) { + gint status; + status = (*self->priv->_command).function (_data1_->auto_pipeline, self); + if (status != 0) { + auto_pipeline_set_return_status (_data1_->auto_pipeline, status); + g_signal_emit_by_name (_data1_->auto_pipeline, "quit"); + } + } + result = FALSE; + return result; +} + + +static gboolean __lambda1__gsource_func (gpointer self) { + gboolean result; + result = _lambda1_ (self); + return result; +} + + +static gpointer _g_object_ref0 (gpointer self) { + return self ? g_object_ref (self) : NULL; +} + + +static Block1Data* block1_data_ref (Block1Data* _data1_) { + g_atomic_int_inc (&_data1_->_ref_count_); + return _data1_; +} + + +static void block1_data_unref (Block1Data* _data1_) { + if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { + _g_object_unref0 (_data1_->self); + _g_object_unref0 (_data1_->auto_pipeline); + g_slice_free (Block1Data, _data1_); + } +} + + +guint task_exec (Task* self, AutoPipeline* auto_pipeline) { + guint result = 0U; + Block1Data* _data1_; + g_return_val_if_fail (self != NULL, 0U); + g_return_val_if_fail (auto_pipeline != NULL, 0U); + _data1_ = g_slice_new0 (Block1Data); + _data1_->_ref_count_ = 1; + _data1_->self = g_object_ref (self); + _data1_->auto_pipeline = _g_object_ref0 (auto_pipeline); + result = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (task_get_seconds (self) * 1000), __lambda1__gsource_func, block1_data_ref (_data1_), block1_data_unref); + block1_data_unref (_data1_); + return result; +} + + +double task_get_seconds (Task* self) { + double result; + g_return_val_if_fail (self != NULL, 0.0); + result = self->priv->_seconds; + return result; +} + + +GValueArray* task_get_arguments (Task* self) { + GValueArray* result; + g_return_val_if_fail (self != NULL, NULL); + result = self->priv->_arguments; + return result; +} + + +static void task_class_init (TaskClass * klass) { + task_parent_class = g_type_class_peek_parent (klass); + g_type_class_add_private (klass, sizeof (TaskPrivate)); + G_OBJECT_CLASS (klass)->get_property = task_get_property; + G_OBJECT_CLASS (klass)->finalize = task_finalize; + g_object_class_install_property (G_OBJECT_CLASS (klass), TASK_SECONDS, g_param_spec_double ("seconds", "seconds", "seconds", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (klass), TASK_ARGUMENTS, g_param_spec_boxed ("arguments", "arguments", "arguments", G_TYPE_VALUE_ARRAY, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); +} + + +static void task_instance_init (Task * self) { + self->priv = TASK_GET_PRIVATE (self); +} + + +static void task_finalize (GObject* obj) { + Task * self; + self = TASK (obj); + _g_value_array_free0 (self->priv->_arguments); + G_OBJECT_CLASS (task_parent_class)->finalize (obj); +} + + +GType task_get_type (void) { + static volatile gsize task_type_id__volatile = 0; + if (g_once_init_enter (&task_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (TaskClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) task_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Task), 0, (GInstanceInitFunc) task_instance_init, NULL }; + GType task_type_id; + task_type_id = g_type_register_static (G_TYPE_OBJECT, "Task", &g_define_type_info, 0); + g_once_init_leave (&task_type_id__volatile, task_type_id); + } + return task_type_id__volatile; +} + + +static void task_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { + Task * self; + self = TASK (object); + switch (property_id) { + case TASK_SECONDS: + g_value_set_double (value, task_get_seconds (self)); + break; + case TASK_ARGUMENTS: + g_value_set_boxed (value, task_get_arguments (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + + + + diff --git a/ivi/gst-auto-launch/src/task.vala b/ivi/gst-auto-launch/src/task.vala new file mode 100755 index 0000000..ae274c8 --- /dev/null +++ b/ivi/gst-auto-launch/src/task.vala @@ -0,0 +1,42 @@ +class Task: Object { + double _seconds; + unowned Command? _command; + ValueArray _arguments; + + + public double seconds { + get { + return _seconds; + } + } + + + public ValueArray arguments { + get { + return _arguments; + } + } + + + public Task(double seconds, Command command) { + _seconds = seconds; + _command = command; + _arguments = new ValueArray(0); + } + + + public uint exec(AutoPipeline auto_pipeline) { + return Timeout.add((uint)(seconds*1000), + () => { + if(auto_pipeline.return_status == 0) { + int status = _command.function(auto_pipeline, this); + if(status != 0) { + auto_pipeline.return_status = status; + auto_pipeline.quit(); + } + } + return false; + }); + } +} + diff --git a/ivi/gst-auto-launch/src/vala.stamp b/ivi/gst-auto-launch/src/vala.stamp new file mode 100755 index 0000000..e69de29 diff --git a/ivi/tts-gstreamer-tests/README b/ivi/tts-gstreamer-tests/README new file mode 100755 index 0000000..3a88cfa --- /dev/null +++ b/ivi/tts-gstreamer-tests/README @@ -0,0 +1,30 @@ +----------------------- + Introduction +----------------------- +The tts-gstreamer-tests is a test suite to test media playing features of gstreamer. + + +----------------------- +How to Run +----------------------- +Pre-condition: +1. Install gstreamer-utils +2. if you don't have testkit-lite, you can get it from https://github.com/testkit/testkit-lite + +Steps: +1. prepare some media files and configure /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/env.sh --- specify in env.sh +2. launch terminal app in weston UI and play an audio by command "paplay /usr/share/sounds/alsa/Front_Center.wav" to trigger Pulseaudio daemon +3. testkit-lite -f /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/tests.xml --comm localhost -o ./results.xml + + + +---------------------- +Test Environment setup +---------------------- +Some media files are needed, you can configure /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/env.sh to specify +them; e.g. MF_TEST_8K="/usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/data/PCM_16bit_Mono_8KHz_128Kbps_60sec\(1Mb\).wav" + + +----------------------- +TODO +----------------------- diff --git a/ivi/tts-gstreamer-tests/src/cleanup.sh b/ivi/tts-gstreamer-tests/src/cleanup.sh new file mode 100755 index 0000000..e4e98b1 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/cleanup.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright (C) 2011, Intel Corporation. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms and conditions of the GNU General Public License, +# version 2, as published by the Free Software Foundation. +# +# This program is distributed in the hope it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place - Suite 330, Boston, MA 02111-1307 USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Cleanup process like gst-launch or su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch + + +# try to kill the process for 3 times +rm -rf /tmp/test_result +COUNT=0 +while [ "$COUNT" -lt 3 ]; do + PID=`ps -eaf | grep -E "gst-launch|gst-auto-launch" | grep -v "grep" | awk '{print $2}'` + if [ -z "$PID" ]; then + break; + fi + + echo "Kill $PID" + kill $PID + let "COUNT += 1" +done diff --git a/ivi/tts-gstreamer-tests/src/env.sh b/ivi/tts-gstreamer-tests/src/env.sh new file mode 100755 index 0000000..aecfe33 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/env.sh @@ -0,0 +1,116 @@ +#!/bin/sh +# +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# +# Authors: +# Zhang, Zhiqiang +# + + +DATA_PATH=$(cd `dirname $0`;pwd)/data +TEST_RESULT="/tmp/test_result" +RET=0 + +## below media files are needed but not include in this package, prepare them before run test ## + +#setup a http server and put some media files on it: +HTTP=http://your.httpserver.com/media + +# used in script:gstreamer_audio_playbin2_http_alaw.sh +## stored in http server +# wav audio: RIFF (little-endian) data, WAVE audio, ITU G.711 A-law, stereo 44100 Hz +GT_HTTP_AUDIO_ALAW="a-LAW_8bit_Stereo_44.1KHz_120sec\(10.1MB\)_AKM.wav" + +# used in script:gstreamer_audio_playbin2_http_imaadpcm.sh +## stored in http server +# wav audio: RIFF (little-endian) data, WAVE audio, IMA ADPCM, stereo 32000 Hz +GT_HTTP_IMAADPCM="IMAADPCM_4bit_Stereo_32KHz_256Kbps_60sec\(1.8Mb\).wav" + +# used in script:gstreamer_audio_playbin2_http_ulaw.sh +## stored in http server +# wav audio: RIFF (little-endian) data, WAVE audio, ITU G.711 mu-law, stereo 44100 Hz +GT_HTTP_AUDIO_ULAW="u-LAW_8bit_Stereo_44.1KHz_120sec\(10MB\)_AKM.wav" + +# used in script:gstreamer_video_http_ogg.sh +## stored in http server +# ogv video: kittens_240p.ogv: Ogg data, Skeleton v4.0 +GT_HTTP_VIDEO_OGV="kittens_240p.ogv" + +# used in script:gstreamer_audio_playbin2_imaadpcm_4bit_stereo_32khz_256kbps.sh +# wav audio: RIFF (little-endian) data, WAVE audio, IMA ADPCM, stereo 32000 Hz +GT_IMAADPCM="/opt/tts-gstreamer-tests/data/IMAADPCM_4bit_Stereo_32KHz_256Kbps_60sec\(1.8Mb\).wav" + +# used in script:gstreamer_audio_playbin2_lpcm_16bit_stereo_44.1khz.sh +# wav audio: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz +GT_AUDIO_LPCM_16="/opt/tts-gstreamer-tests/data/LPCM_16bit_Stereo_44.1KHz_60sec\(10Mb\).wav" + +# used in script:gstreamer_audio_playbin2_lpcm_24bit_stereo_48khz.sh +# wav audio: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 24 bit, stereo 48000 Hz +GT_AUDIO_LPCM_24="/opt/tts-gstreamer-tests/data/LPCM_24bit_Stereo_48KHz_60sec\(16.8Mb\).wav" + +# used in script:gstreamer_audio_playbin2_ogg_vorbis_16bit_mono_8khz_42kbps.sh +# ogg audio: Ogg data, Vorbis audio, mono, 8000 Hz, ~41997 bps +GT_OGG_MONO="/opt/tts-gstreamer-tests/data/OGG_16bit_Mono_8KHz_42Kbps_2min\(0.5MB\).ogg" + +# used in scripts: +# gstreamer_audio_avidemux.sh +# gstreamer_audio_pause_avidemux.sh +# gstreamer_audio_play_avidemux.sh +# gstreamer_audio_playbin2_alaw_8bit_stereo_44.1khz.sh +# gstreamer_audio_resume_avidemux.sh +# gstreamer_audio_resume_avidemux.sh +# gstreamer_audio_seek_avidemux.sh +# gstreamer_audio_stop_avidemux.sh +# avi audio: RIFF (little-endian) data, AVI, 0 x 0, >30 fps +GT_AUDIO_PCM_16="/opt/tts-gstreamer-tests/data/PCM_16bit_Stereo_44.1KHz_1411Kbps_60sec.avi" + +# used in script:gstreamer_image_jpegdec.sh +# jpeg file: JPEG image data, EXIF standard +GT_IMAGE_JPG="/opt/tts-gstreamer-tests/data/butterfly.jpg" + +# used in scripts: +# gstreamer_audio_alsasink.sh +# gstreamer_audio_pause_ogg.sh +# gstreamer_audio_play_ogg.sh +# gstreamer_audio_pulsesink.sh +# gstreamer_audio_resume_ogg.sh +# gstreamer_audio_seek_ogg.sh +# gstreamer_audio_stop_ogg.sh +# gstreamer_audio_vorbisdec.sh +# gstreamer_video_oggdemux.sh +# gstreamer_video_pause_oggdemux.sh +# gstreamer_video_playbin2_ogg_theora_vorbis.sh +# gstreamer_video_play_oggdemux.sh +# gstreamer_video_resume_oggdemux.sh +# gstreamer_video_seek_oggdemux.sh +# gstreamer_video_stop_oggdemux.sh +# gstreamer_video_theoradec.sh +# ogg video: Ogg data, Skeleton v4.0 +GT_KITTENS="/opt/tts-gstreamer-tests/data/kittens.ogg" + +# used in script:gstreamer_image_pngdec.sh +# png file: PNG image data, 640 x 320, 8-bit/color RGB, non-interlaced +GT_IMAGE_PNG="/opt/tts-gstreamer-tests/data/timer2.png" + +# used in script:gstreamer_audio_playbin2_ulaw_8bit_stereo_44.1khz.sh +# wav audio: RIFF (little-endian) data, WAVE audio, ITU G.711 mu-law, stereo 44100 Hz +GT_AUDIO_ULAW="/opt/tts-gstreamer-tests/data/u-LAW_8bit_Stereo_44.1KHz_120sec\(10MB\)_AKM.wav" + +## END ## + +export DISPLAY=:0.0 diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_alawenc.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_alawenc.sh new file mode 100755 index 0000000..24511a2 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_alawenc.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer a-law encode status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 autoaudiosrc num-buffers=100 ! audioconvert ! alawenc ! wavenc ! filesink location=/tmp/mulawenc.wav &> $TEST_RESULT &" +else + gst-launch-1.0 autoaudiosrc num-buffers=100 ! audioconvert ! alawenc ! wavenc ! filesink location=/tmp/mulawenc.wav &> $TEST_RESULT & +fi + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer alawenc pass" +else + echo "gstreamer alawenc fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_alsasink.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_alsasink.sh new file mode 100755 index 0000000..968467a --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_alsasink.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer and autoaudiosink integration status +# +# TIMEOUT : 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 filesrc location="${GT_KITTENS}" num-buffers=30 ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer alsasink pass" +else + echo "gstreamer alsasink fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_avidemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_avidemux.sh new file mode 100755 index 0000000..2a23ec9 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_avidemux.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer avidemux work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 filesrc location=${GT_AUDIO_PCM_16} num-buffers=30 ! avidemux name=demux demux.audio_0 ! decodebin ! audioconvert ! audioresample ! autoaudiosink &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer avidemux pass" +else + echo "gstreamer avidemux fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_mulawenc.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_mulawenc.sh new file mode 100755 index 0000000..f15f108 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_mulawenc.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer u-law encode status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 autoaudiosrc num-buffers=100 ! audioconvert ! mulawenc ! wavenc ! filesink location=/tmp/mulawenc.wav &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer alawenc pass" +else + echo "gstreamer alawenc fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_alaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_alaw.sh new file mode 100755 index 0000000..90d061c --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_alaw.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check pause status for audio a-LAW format. +# +# TIMEOUT: 160 +set -x + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/a-LAW_8bit_Stereo_44.1KHz_120sec\(10.1MB\)_AKM.wav num-buffers=200 ! wavparse ! alawdec ! audioconvert ! autoaudiosink 0:play 5:pause 10:play &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "PAUSED") + + +if [ "$a" = "Passing to PAUSED" ]; then + echo "gstreamer pause pass" +else + echo "gstreamer pause fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_avidemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_avidemux.sh new file mode 100755 index 0000000..1a2475f --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_avidemux.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer avidemux pause status +# +# TIMEOUT: 200 +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_AUDIO_PCM_16} num-buffers=50 ! avidemux name=demux demux.audio_0 ! decodebin ! audioconvert ! audioresample ! autoaudiosink 0:play 0.5:pause 1:play &> $TEST_RESULT &" + +sleep 10 + +a=$(cat $TEST_RESULT | grep "PAUSED") + + +if [ "$a" = "Passing to PAUSED" ]; then + echo "gstreamer avidemux pause pass" +else + echo "gstreamer avidemux pause fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_lpcm.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_lpcm.sh new file mode 100755 index 0000000..8c47cd6 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_lpcm.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check pause status for audio Linear PCM format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/LPCM_16bit_Stereo_44.1KHz_60sec\(10Mb\).wav num-buffers=200 ! wavparse ! audioconvert ! autoaudiosink 0:play 2:pause 5:play &> $TEST_RESULT &" + +sleep 10 + +a=$(cat $TEST_RESULT | grep "PAUSED") + + +if [ "$a" = "Passing to PAUSED" ]; then + echo "gstreamer pause pass" +else + echo "gstreamer pause fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_ogg.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_ogg.sh new file mode 100755 index 0000000..244e0f7 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_ogg.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# Modification: +# Li Cathy Date: 2012-03-07 +# Refine the pipeline +## +# DESCR: +# Check gstreamer play status for ogg codec +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:pause 10:play &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "PAUSED") + + +if [ "$a" = "Passing to PAUSED" ]; then + echo "gstreamer pause pass" +else + echo "gstreamer pause fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_ulaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_ulaw.sh new file mode 100755 index 0000000..bc9ef60 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pause_ulaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check pause status for audio u-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/u-LAW_8bit_Stereo_44.1KHz_120sec\(10MB\)_AKM.wav num-buffers=200 ! wavparse ! mulawdec ! audioconvert ! autoaudiosink 0:play 5:pause 10:play &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "PAUSED") + + +if [ "$a" = "Passing to PAUSED" ]; then + echo "gstreamer pause pass" +else + echo "gstreamer pause fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_alaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_alaw.sh new file mode 100755 index 0000000..18926e0 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_alaw.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check play status for audio a-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/a-LAW_8bit_Stereo_44.1KHz_120sec\(10.1MB\)_AKM.wav num-buffers=50 ! wavparse ! alawdec ! audioconvert ! autoaudiosink 2:play &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") +echo $a + + +if [ "$a" = "Passing to PLAYING" ]; then + echo "gstreamer play pass" +else + echo "gstreamer play fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_avidemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_avidemux.sh new file mode 100755 index 0000000..39e8bb1 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_avidemux.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer avidemux play status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_AUDIO_PCM_16} num-buffers=30 ! avidemux name=demux demux.audio_00 ! decodebin ! audioconvert ! audioresample ! autoaudiosink 0:play &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + +if [ "$a" = "Passing to PLAYING" ]; then + echo "gstreamer avidemux play pass" +else + echo "gstreamer avidemux play fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_lpcm.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_lpcm.sh new file mode 100755 index 0000000..c3ddf52 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_lpcm.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check play status for audio Linear PCM format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/LPCM_16bit_Stereo_44.1KHz_60sec\(10Mb\).wav num-buffers=50 ! wavparse ! audioconvert ! autoaudiosink 0:play &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Passing to PLAYING" ]; then + echo "gstreamer play pass" +else + echo "gstreamer play fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_ogg.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_ogg.sh new file mode 100755 index 0000000..17ceca8 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_ogg.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer play status for ogg codec +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux ! vorbisdec ! audioconvert ! autoaudiosink 0:play &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Passing to PLAYING" ]; then + echo "gstreamer play pass" +else + echo "gstreamer play fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_ulaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_ulaw.sh new file mode 100755 index 0000000..ef34aab --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_play_ulaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check play status for audio u-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/u-LAW_8bit_Stereo_44.1KHz_120sec\(10MB\)_AKM.wav num-buffers=50 ! wavparse ! mulawdec ! audioconvert ! autoaudiosink 0:play &> $TEST_RESULT &" + +sleep 10 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Passing to PLAYING" ]; then + echo "gstreamer play pass" +else + echo "gstreamer play fail" + cat $TEST_RESULT + ERT=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_alaw_8bit_stereo_44.1khz.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_alaw_8bit_stereo_44.1khz.sh new file mode 100755 index 0000000..e3e7e4e --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_alaw_8bit_stereo_44.1khz.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check local audio playback of a-LAW format by gst-launch-1.0 and +# playbin2 with uri only. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "file://${GT_AUDIO_PCM_16}" + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_alaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_alaw.sh new file mode 100755 index 0000000..31cd38b --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_alaw.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check streamimg audio through http of a-LAW format +# by gst-launch-1.0 and playbin2 with uri only. +# +# TIMEOUT: 300 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "$HTTP/${GT_HTTP_AUDIO_ALAW}" 15 + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_imaadpcm.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_imaadpcm.sh new file mode 100755 index 0000000..77af118 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_imaadpcm.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check streamimg audio through http of IMA ADPCM format +# by gst-launch-1.0 and playbin2 with uri only. +# +# TIMEOUT: 300 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "$HTTP/${GT_HTTP_IMAADPCM}" 15 + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_lpcm.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_lpcm.sh new file mode 100755 index 0000000..2730e50 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_lpcm.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check streamimg audio through http of Linear PCM format +# by gst-launch-1.0 and playbin2 with uri only. +# +# TIMEOUT: 300 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "$HTTP/Contents/Audio/Linear_PCM/LPCM_16bit_Stereo_44.1KHz_60sec(10Mb).wav" 15 + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_ulaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_ulaw.sh new file mode 100755 index 0000000..d860713 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_http_ulaw.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check streamimg audio through http of u-LAW format +# by gst-launch-1.0 and playbin2 with uri only. +# +# TIMEOUT: 300 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "$HTTP/${GT_HTTP_AUDIO_ULAW}" 15 + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_imaadpcm_4bit_stereo_32khz_256kbps.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_imaadpcm_4bit_stereo_32khz_256kbps.sh new file mode 100755 index 0000000..0328def --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_imaadpcm_4bit_stereo_32khz_256kbps.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check local audio playback of IMA ADPCM format by gst-launch-1.0 and +# playbin2 with uri only. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "file://${GT_IMAADPCM}" + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_lpcm_16bit_stereo_44.1khz.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_lpcm_16bit_stereo_44.1khz.sh new file mode 100755 index 0000000..b72836e --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_lpcm_16bit_stereo_44.1khz.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check local audio playback of Linear PCM format by gst-launch-1.0 and +# playbin2 with uri only. +# +# TIMEOUT: 90 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "file://${GT_AUDIO_LPCM_16}" + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_lpcm_24bit_stereo_48khz.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_lpcm_24bit_stereo_48khz.sh new file mode 100755 index 0000000..7f3e658 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_lpcm_24bit_stereo_48khz.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check local audio playback of Linear PCM format by gst-launch-1.0 and +# playbin2 with uri only. +# +# TIMEOUT: 90 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "file://${GT_AUDIO_LPCM_24}" + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_ogg_vorbis_16bit_mono_8khz_42kbps.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_ogg_vorbis_16bit_mono_8khz_42kbps.sh new file mode 100755 index 0000000..dc560d4 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_ogg_vorbis_16bit_mono_8khz_42kbps.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check local audio playback of OGG-Vorbis format by gst-launch-1.0 and +# playbin2 with uri only. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "file://${GT_OGG_MONO}" + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_ulaw_8bit_stereo_44.1khz.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_ulaw_8bit_stereo_44.1khz.sh new file mode 100755 index 0000000..ac07a21 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_playbin2_ulaw_8bit_stereo_44.1khz.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check local audio playback of u-LAW format by gst-launch-1.0 and +# playbin2 with uri only. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "file://${GT_AUDIO_ULAW}" + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_pulsesink.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pulsesink.sh new file mode 100755 index 0000000..ad46c54 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pulsesink.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check pulsesink plugins work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 -v filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! volume volume=0.9 ! pulsesink &> $TEST_RESULT &" +else + gst-launch-1.0 -v filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! volume volume=0.9 ! pulsesink &> $TEST_RESULT & +fi +sleep 10 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer pulsesink pass" +else + echo "gstreamer pulsesink fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_pulsesrc.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pulsesrc.sh new file mode 100755 index 0000000..7780f06 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_pulsesrc.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer pulsesrc status, which captures audio +# from a PulseAudio server +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 pulsesrc num-buffers=100 ! audioconvert ! wavenc ! filesink location=/tmp/pulsesrc.wav > $TEST_RESULT" +else + gst-launch-1.0 pulsesrc num-buffers=100 ! audioconvert ! wavenc ! filesink location=/tmp/pulsesrc.wav > $TEST_RESULT +fi + +sleep 10 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer pulsesrc pass" +else + echo "gstreamer pulsesrc fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_alaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_alaw.sh new file mode 100755 index 0000000..a058d99 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_alaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check resume status for audio a-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/a-LAW_8bit_Stereo_44.1KHz_120sec\(10.1MB\)_AKM.wav num-buffers=300 ! wavparse ! alawdec ! audioconvert ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer resume pass" +else + echo "gstreamer resume fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_avidemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_avidemux.sh new file mode 100755 index 0000000..e0a01d7 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_avidemux.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer avidemux resume status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_AUDIO_PCM_16} num-buffers=60 ! avidemux name=demux demux.audio_0 ! decodebin ! audioconvert ! audioresample ! autoaudiosink 0:play 0.5:stop 1:seek:1.5 &> $TEST_RESULT &" +else + gst-auto-launch filesrc location=${GT_AUDIO_PCM_16} num-buffers=60 ! avidemux name=demux demux.audio_0 ! decodebin ! audioconvert ! audioresample ! autoaudiosink 0:play 0.5:stop 1:seek:1.5 &> $TEST_RESULT & +fi + +sleep 5 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer avidemux resume pass" +else + echo "gstreamer avidemux resume fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_lpcm.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_lpcm.sh new file mode 100755 index 0000000..c1cbb9f --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_lpcm.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check resume status for audio Linear PCM format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/LPCM_16bit_Stereo_44.1KHz_60sec\(10Mb\).wav num-buffers=300 ! wavparse ! audioconvert ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer resume pass" +else + echo "gstreamer resume fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_ogg.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_ogg.sh new file mode 100755 index 0000000..e0b2890 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_ogg.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer resume status for ogg codec +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} ! oggdemux ! vorbisdec ! audioconvert ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer resume pass" +else + echo "gstreamer resume fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_ulaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_ulaw.sh new file mode 100755 index 0000000..c695c89 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_resume_ulaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check resume status for audio u-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/u-LAW_8bit_Stereo_44.1KHz_120sec\(10MB\)_AKM.wav num-buffers=300 ! wavparse ! mulawdec ! audioconvert ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer resume pass" +else + echo "gstreamer resume fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_alaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_alaw.sh new file mode 100755 index 0000000..1f3f553 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_alaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check seek status for audio a-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/a-LAW_8bit_Stereo_44.1KHz_120sec\(10.1MB\)_AKM.wav num-buffers=50 ! wavparse ! alawdec ! audioconvert ! autoaudiosink 0:play 1:pause 2:seek:10 12:play &> $TEST_RESULT &" + +sleep 30 + +a=$(cat $TEST_RESULT | grep "Seeking") + + +if [ "$a" = "Seeking to second 10.000000" ]; then + echo "gstreamer seek pass" +else + echo "gstreamer seek fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_avidemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_avidemux.sh new file mode 100755 index 0000000..4735cd0 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_avidemux.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer avidemux seek status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_AUDIO_PCM_16} num-buffers=60 ! avidemux name=demux demux.audio_0 ! decodebin ! audioconvert ! audioresample ! autoaudiosink 0:play 0.5:seek:1 2:play &> $TEST_RESULT &" + +sleep 10 + +a=$(cat $TEST_RESULT | grep "Seeking") + + +if [ "$a" = "Seeking to second 1.000000" ]; then + echo "gstreamer avidemux seek pass" +else + echo "gstreamer avidemux seek fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_lpcm.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_lpcm.sh new file mode 100755 index 0000000..dfde91c --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_lpcm.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check seek status for audio Linear PCM format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/LPCM_16bit_Stereo_44.1KHz_60sec\(10Mb\).wav num-buffers=50 ! wavparse ! audioconvert ! autoaudiosink 0:play 1:pause 2:seek:10 12:play &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "Seeking") + + +if [ "$a" = "Seeking to second 10.000000" ]; then + echo "gstreamer seek pass" +else + echo "gstreamer seek fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_ogg.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_ogg.sh new file mode 100755 index 0000000..47321ae --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_ogg.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer seek status for ogg codec +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 1:pause 2:seek:10 12:play &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "Seeking") + + +if [ "$a" = "Seeking to second 10.000000" ]; then + echo "gstreamer seek pass" +else + echo "gstreamer seek fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_ulaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_ulaw.sh new file mode 100755 index 0000000..6c89806 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_seek_ulaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check seek status for audio u-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/u-LAW_8bit_Stereo_44.1KHz_120sec\(10MB\)_AKM.wav num-buffers=50 ! wavparse ! mulawdec ! audioconvert ! autoaudiosink 0:play 1:pause 2:seek:10 12:play &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "Seeking") + + +if [ "$a" = "Seeking to second 10.000000" ]; then + echo "gstreamer seek pass" +else + echo "gstreamer seek fail" + cat $TEST_RESULT + exit 1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_alaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_alaw.sh new file mode 100755 index 0000000..60c2ccf --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_alaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check stop status for audio a-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/a-LAW_8bit_Stereo_44.1KHz_120sec\(10.1MB\)_AKM.wav num-buffers=300 ! wavparse ! alawdec ! audioconvert ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer stop pass" +else + echo "gstreamer stop fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_avidemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_avidemux.sh new file mode 100755 index 0000000..bc1e047 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_avidemux.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer avidemux work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_AUDIO_PCM_16} num-buffers=50 ! avidemux name=demux demux.audio_0 ! decodebin ! audioconvert ! audioresample ! autoaudiosink 0:play 0.5:stop 1:seek:1.5 &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer avidemux stop pass" +else + echo "gstreamer avidemux stop fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_lpcm.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_lpcm.sh new file mode 100755 index 0000000..56eae16 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_lpcm.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check stop status for audio Linear PCM format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/LPCM_16bit_Stereo_44.1KHz_60sec\(10Mb\).wav num-buffers=300 ! wavparse ! audioconvert ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer stop pass" +else + echo "gstreamer stop fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_ogg.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_ogg.sh new file mode 100755 index 0000000..ef5cea5 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_ogg.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer stop status for ogg codec +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer stop pass" +else + echo "gstreamer stop fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_ulaw.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_ulaw.sh new file mode 100755 index 0000000..419449b --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_stop_ulaw.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check stop status for audio u-LAW format. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=$DATA_PATH/u-LAW_8bit_Stereo_44.1KHz_120sec\(10MB\)_AKM.wav num-buffers=300 ! wavparse ! mulawdec ! audioconvert ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer stop pass" +else + echo "gstreamer stop fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_vorbisdec.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_vorbisdec.sh new file mode 100755 index 0000000..9125a76 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_vorbisdec.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check vorbisdec work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux ! vorbisdec ! audioconvert ! autoaudiosink &> $TEST_RESULT &" + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer vorbisdec pass" +else + echo "gstreamer vorbisdec fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_audio_vorbisenc.sh b/ivi/tts-gstreamer-tests/src/gstreamer_audio_vorbisenc.sh new file mode 100755 index 0000000..d4919eb --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_audio_vorbisenc.sh @@ -0,0 +1,58 @@ +#!/bin/bash +#DESCR : Check gstreamer vorbis codec encode status +#TIMEOUT : 200 + +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check vorbisenc work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ -f /tmp/vorbisenc.ogg ];then rm -rf /tmp/vorbisenc.ogg;fi +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 -v pulsesrc num-buffers=100 ! audioconvert ! vorbisenc ! oggmux ! filesink location=/tmp/vorbisenc.ogg &>$TEST_RESULT &" +else + gst-launch-1.0 -v pulsesrc num-buffers=100 ! audioconvert ! vorbisenc ! oggmux ! filesink location=/tmp/vorbisenc.ogg &>$TEST_RESULT & +fi + +#gst-launch-1.0 -v autoaudiosrc num-buffers=100 ! audioconvert ! vorbisenc ! oggmux ! filesink location=/tmp/vorbisenc.ogg &>$TEST_RESULT & + +sleep 5 + +a=$(cat $TEST_RESULT | grep "EOS") + + +if [ "$a" = "Got EOS from element \"pipeline0\"." ]; then + echo "gstreamer vorbisenc pass" +else + echo "gstreamer vorbisenc fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_image_jpegdec.sh b/ivi/tts-gstreamer-tests/src/gstreamer_image_jpegdec.sh new file mode 100755 index 0000000..d62fd28 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_image_jpegdec.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer jpeg decode status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 playbin uri="file://${GT_IMAGE_JPG}" &> $TEST_RESULT" +else + gst-launch-1.0 playbin uri="file://${GT_IMAGE_JPG}" &> $TEST_RESULT +fi +#gst-launch-1.0 filesrc location=$DATA_PATH/butterfly.jpg ! decodebin ! videoconvert ! autovideosink &> $TEST_RESULT +#gst-launch-1.0 filesrc location=$DATA_PATH/butterfly.jpg ! jpegdec ! videoscale ! autovideosink &> $TEST_RESULT + +a=$(cat $TEST_RESULT | grep "EOS") + +#if [ "$a" = "Got EOS from element \"pipeline0\"." ]; then +if [ "$a" = "Got EOS from element \"playbin0\"." ]; then + echo "gstreamer jpegdec pass" +else + echo "gstreamer jpegdec fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_image_jpegenc.sh b/ivi/tts-gstreamer-tests/src/gstreamer_image_jpegenc.sh new file mode 100755 index 0000000..0691951 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_image_jpegenc.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer JPEG encode status +# +# TIMEOUT: 60 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 v4l2src num-buffers=1 ! jpegenc ! filesink location=/tmp/jpegenc.jpg &> $TEST_RESULT &" +else + gst-launch-1.0 v4l2src num-buffers=1 ! jpegenc ! filesink location=/tmp/jpegenc.jpg &> $TEST_RESULT & +fi + +#gst-launch-1.0 v4l2src num-buffers=1 ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! jpegenc ! filesink location=/tmp/jpegenc.jpg &> $TEST_RESULT & + +sleep 5 + +a=$(cat $TEST_RESULT | grep "New clock") + + +if [ "$a" = "New clock: GstSystemClock" ]; then + echo "gstreamer jpegenc pass" +else + echo "gstreamer jpegenc fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_image_pngdec.sh b/ivi/tts-gstreamer-tests/src/gstreamer_image_pngdec.sh new file mode 100755 index 0000000..ee5ab98 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_image_pngdec.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer png decode status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 filesrc location=${GT_IMAGE_PNG} ! decodebin ! videoconvert ! autovideosink &> $TEST_RESULT" +else + gst-launch-1.0 filesrc location=${GT_IMAGE_PNG} ! decodebin ! videoconvert ! autovideosink &> $TEST_RESULT +fi +#gst-launch-1.0 filesrc location=$DATA_PATH/timer2.png ! pngdec ! videoscale ! autovideosink &> $TEST_RESULT + +sleep 1 + +a=$(cat $TEST_RESULT | grep "EOS") + + +if [ "$a" = "Got EOS from element \"pipeline0\"." ]; then + echo "gstreamer pngdec pass" +else + echo "gstreamer pngdec fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_image_pngenc.sh b/ivi/tts-gstreamer-tests/src/gstreamer_image_pngenc.sh new file mode 100755 index 0000000..c270fa5 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_image_pngenc.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer PNG encode status +# +# TIMEOUT: 60 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 v4l2src num-buffers=1 ! autovideoconvert ! pngenc ! filesink location=/tmp/pngenc.jpg &> $TEST_RESULT &" +else + gst-launch-1.0 v4l2src num-buffers=1 ! autovideoconvert ! pngenc ! filesink location=/tmp/pngenc.jpg &> $TEST_RESULT & +fi +#gst-launch-1.0 v4l2src num-buffers=1 ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! pngenc ! filesink location=/tmp/pngenc.jpg &> $TEST_RESULT & + +sleep 5 + +a=$(cat $TEST_RESULT | grep "New clock") + + +if [ "$a" = "New clock: GstSystemClock" ]; then + echo "gstreamer pngenc pass" +else + echo "gstreamer pngenc fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_http_ogg.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_http_ogg.sh new file mode 100755 index 0000000..5c4e0d3 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_http_ogg.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI < jessica.ji@intel.com > +# Zhiqiang Zhang +# +# DESCR: +# Check http status of OGG Theora Vorbis format +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +$(cd `dirname $0`;pwd)/playbin2.sh "$HTTP/${GT_HTTP_VIDEO_OGV}" 15 + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_oggdemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_oggdemux.sh new file mode 100755 index 0000000..b1e5a77 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_oggdemux.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer oggdemux work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink &> $TEST_RESULT &" +else + gst-launch-1.0 filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink &> $TEST_RESULT & +fi +sleep 10 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer oggdemux pass" +else + echo "gstreamer oggdemux fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_pause_oggdemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_pause_oggdemux.sh new file mode 100755 index 0000000..24fbc1c --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_pause_oggdemux.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer oggdemux pause status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:pause 10:play &> $TEST_RESULT &" +else + gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:pause 10:play &> $TEST_RESULT & +fi + +sleep 12 + +a=$(cat $TEST_RESULT | grep "PAUSED") + + +if [ "$a" = "Passing to PAUSED" ]; then + echo "gstreamer oggdemux pause pass" +else + echo "gstreamer oggdemux pause fail" + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_play_oggdemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_play_oggdemux.sh new file mode 100755 index 0000000..7039329 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_play_oggdemux.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer oggdemux play status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play &> $TEST_RESULT &" +else + gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play &> $TEST_RESULT & +fi + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") +echo $a + + +if [ "$a" = "Passing to PLAYING" ]; then + echo "gstreamer oggdemux play pass" +else + echo "gstreamer oggdemux play fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_playbin2_ogg_theora_vorbis.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_playbin2_ogg_theora_vorbis.sh new file mode 100755 index 0000000..b3921ec --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_playbin2_ogg_theora_vorbis.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# DESCR: +# Check local video playback of OGG-Theora-Vorbis format +# by gst-launch-1.0 and playbin2 with uri only. +# +# TIMEOUT: 160 + + +. $(cd `dirname $0`;pwd)/env.sh + + +$(cd `dirname $0`;pwd)/playbin2.sh "file://${GT_KITTENS}" + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_resume_oggdemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_resume_oggdemux.sh new file mode 100755 index 0000000..7026a5b --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_resume_oggdemux.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer oggdemux resume status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" +else + gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT & +fi +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer oggdemux resume pass" +else + echo "gstreamer oggav resume fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_seek_oggdemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_seek_oggdemux.sh new file mode 100755 index 0000000..0d36217 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_seek_oggdemux.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer oggdemux seek status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 1:pause 2:seek:10 12:play &>$TEST_RESULT" +else + gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 1:pause 2:seek:10 12:play &>$TEST_RESULT +fi + +sleep 15 + +a=$(cat $TEST_RESULT | grep "Seeking") + + +if [ "$a" = "Seeking to second 10.000000" ]; then + echo "gstreamer oggdemux seek pass" +else + echo "gstreamer oggdemux seek fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_stop_oggdemux.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_stop_oggdemux.sh new file mode 100755 index 0000000..9e916e4 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_stop_oggdemux.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (C) 2008-2011 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check gstreamer oggdemux stop status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT &" +else + gst-auto-launch filesrc location=${GT_KITTENS} num-buffers=50 ! oggdemux name=demuxer demuxer. ! queue ! theoradec ! videoscale ! autovideosink demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink 0:play 5:stop 6:seek:10 &> $TEST_RESULT & +fi + +sleep 15 + +a=$(cat $TEST_RESULT | grep "READY") + + +if [ "$a" = "Passing to READY" ]; then + echo "gstreamer oggdemux stop pass" +else + echo "gstreamer oggdemux stop fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_theoradec.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_theoradec.sh new file mode 100755 index 0000000..2a3380d --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_theoradec.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check theoradec work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux ! theoradec ! videoscale ! autovideosink &> $TEST_RESULT &" +else + gst-launch-1.0 filesrc location=${GT_KITTENS} num-buffers=30 ! oggdemux ! theoradec ! videoscale ! autovideosink &> $TEST_RESULT & +fi + +sleep 5 + +a=$(cat $TEST_RESULT | grep "PLAYING") + + +if [ "$a" = "Setting pipeline to PLAYING ..." ]; then + echo "gstreamer theoradec pass" +else + echo "gstreamer theoradec fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/gstreamer_video_theoraenc.sh b/ivi/tts-gstreamer-tests/src/gstreamer_video_theoraenc.sh new file mode 100755 index 0000000..ff8c6f6 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/gstreamer_video_theoraenc.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2008 Intel Corporation. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this software; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. +# +# Authors: +# Jessica JI +# Zhang Zhiqiang +# +# DESCR: +# Check theoraenc work status +# +# TIMEOUT: 200 + + +. $(cd `dirname $0`;pwd)/env.sh + +su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 v4l2src num-buffers=20 ! autovideoconvert ! theoraenc ! oggmux ! filesink location=/tmp/theoraenc.ogg &> $TEST_RESULT &" + +sleep 30 + +a=$(cat $TEST_RESULT | grep "New clock") + + +if [ "$a" = "New clock: GstSystemClock" ]; then + echo "gstreamer thenraenc pass" +else + echo "gstreamer thenoraenc fail" + cat $TEST_RESULT + RET=1 +fi + +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + + diff --git a/ivi/tts-gstreamer-tests/src/playbin2.sh b/ivi/tts-gstreamer-tests/src/playbin2.sh new file mode 100755 index 0000000..2c0cf43 --- /dev/null +++ b/ivi/tts-gstreamer-tests/src/playbin2.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Copyright (C) 2011, Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2 of the License, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Authors: +# Zhang Zhiqiang +# +# Modificator: +# Li Cathy Date: 2012-02-24 +# +# DESCR: +# Test GStreamer pipeline using playbin2 with uri only. +# + + +# check parameter sanity +if [ $# -lt 1 ]; then + echo "Usage: $0 [TIMEOUT]" + echo " URI is to set playbin uri with protocol FILEE/HTTP/RTSP" + echo " TIMEOUT is the time in seconds you want playbin2 to play the media" + echo "You need to set URI of the media file to play" + exit 1 +fi + + +. $(cd `dirname $0`;pwd)/env.sh + + +# play the media with GStreamer su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch and playbin2 for 10 seconds +# su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-auto-launch playbin2 uri=$1 0:play 10:eos + +# play the media with GStreamer gst-launch and playbin2 +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 && gst-launch-1.0 playbin uri="$1" &> $TEST_RESULT &" +else + gst-launch-1.0 playbin uri=$1 &> $TEST_RESULT & +fi + +# check error message after TIMEOUT or 3 seconds +if [ -n "$2" ]; then + sleep $2 +else + sleep 3 +fi + +ERR=$(cat $TEST_RESULT | grep "ERROR") + +if [ -n "$ERR" ]; then + cat $TEST_RESULT + RET=1 +fi + +# clean up +. $(cd `dirname $0`;pwd)/cleanup.sh +exit $RET + diff --git a/ivi/tts-gstreamer-tests/tests.xml b/ivi/tts-gstreamer-tests/tests.xml new file mode 100644 index 0000000..1fe4029 --- /dev/null +++ b/ivi/tts-gstreamer-tests/tests.xml @@ -0,0 +1,1039 @@ + + + + + + + + + + + Check streamimg audio through http of IMA ADPCM format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_http_imaadpcm.sh + + + Netbook + TV + + + + + + + + + Check local audio playback of IMA ADPCM format by gst-launch-0.10 and playbin2 with uri only. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_imaadpcm_4bit_stereo_32khz_256kbps.sh + + + Netbook + TV + + + + + + + + + + + Check gstreamer and alsa plugins integration status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_alsasink.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer pause status for ogg codec + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_pause_ogg.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer play status for ogg codec + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_play_ogg.sh + + + IVI + Netbook + TV + + + + + + + + + Check local audio playback of OGG-Vorbis format by gst-launch-0.10 and playbin2 with uri only. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_ogg_vorbis_16bit_mono_8khz_42kbps.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer resume status for ogg codec + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_resume_ogg.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer seek status for ogg codec + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_seek_ogg.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer stop status for ogg codec + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_stop_ogg.sh + + + IVI + Netbook + TV + + + + + + + + + Check vorbisdec work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_vorbisdec.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer vorbis codec encode status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_vorbisenc.sh + + + IVI + Netbook + TV + + + + + + + + + + Check gstreamer http plugins work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_http_ogg.sh + + + IVI + Netbook + TV + + + + + + + + + Check oggdemux work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_oggdemux.sh + + + IVI + Netbook + TV + + + + + + + + + + Check gstreamer oggdemux for pause status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_pause_oggdemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer oggdemux for play status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_play_oggdemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check local video playback of OGG-Theora-Vorbis format by gst-launch-0.10 and playbin2 with uri only. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_playbin2_ogg_theora_vorbis.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer oggdemux for resume status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_resume_oggdemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer oggdemux for seek status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_seek_oggdemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer oggdemux for stop status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_stop_oggdemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check theoradec plugins work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_theoradec.sh + + + Netbook + TV + IVI + + + + + + + + + Check gstreamer theora codec encode status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_video_theoraenc.sh + + + Netbook + TV + IVI_Crossville + + + + + + + + + + + Check alawenc plugins work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_alawenc.sh + + + IVI + Netbook + TV + + + + + + + + + Check avidemux plugins work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_avidemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check mulawsrc plugins work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_mulawenc.sh + + + IVI + Netbook + TV + + + + + + + + + Check pause status for audio a-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_pause_alaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer avidemux for pause status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_pause_avidemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check pause status for audio Linear PCM format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_pause_lpcm.sh + + + IVI + Netbook + TV + + + + + + + + + Check pause status for audio u-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_pause_ulaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check play status for audio a-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_play_alaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer avidemux for play status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_play_avidemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check play status for audio Linear PCM format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_play_lpcm.sh + + + IVI + Netbook + TV + + + + + + + + + Check play status for audio u-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_play_ulaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check local audio playback of a-LAW format by gst-launch-0.10 and playbin2 with uri only. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_alaw_8bit_stereo_44.1khz.sh + + + IVI + Netbook + TV + + + + + + + + + Check streamimg audio through http of a-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_http_alaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check streamimg audio through http of Linear PCM format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_http_lpcm.sh + + + IVI + Netbook + TV + + + + + + + + + Check streamimg audio through http of u-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_http_ulaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check local audio playback of Linear PCM format by gst-launch-0.10 and playbin2 with uri only. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_lpcm_16bit_stereo_44.1khz.sh + + + IVI + Netbook + TV + + + + + + + + + Check local audio playback of Linear PCM format by gst-launch-0.10 and playbin2 with uri only. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_lpcm_24bit_stereo_48khz.sh + + + IVI + Netbook + TV + + + + + + + + + Check local audio playback of u-LAW format by gst-launch-0.10 and playbin2 with uri only. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_playbin2_ulaw_8bit_stereo_44.1khz.sh + + + IVI + Netbook + TV + + + + + + + + + Check pulsesink plugins work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_pulsesink.sh + + + IVI + Netbook + TV + + + + + + + + + Check pulsesrc plugins work status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_pulsesrc.sh + + + IVI + Netbook + TV + + + + + + + + + Check resume status for audio a-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_resume_alaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer avidemux for resume status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_resume_avidemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check resume status for audio Linear PCM format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_resume_lpcm.sh + + + IVI + Netbook + TV + + + + + + + + + Check resume status for audio u-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_resume_ulaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check seek status for audio a-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_seek_alaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer avidemux for seek status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_seek_avidemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check seek status for audio Linear PCM format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_seek_lpcm.sh + + + IVI + Netbook + TV + + + + + + + + + Check seek status for audio u-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_seek_ulaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check stop status for audio a-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_stop_alaw.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer avidemux for stop status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_stop_avidemux.sh + + + IVI + Netbook + TV + + + + + + + + + Check stop status for audio Linear PCM format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_stop_lpcm.sh + + + IVI + Netbook + TV + + + + + + + + + Check stop status for audio u-LAW format. + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_audio_stop_ulaw.sh + + + IVI + Netbook + TV + + + + + + + + + + Check gstreamer jpeg decode status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_image_jpegdec.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer jpeg encode status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_image_jpegenc.sh + + + Netbook + TV + IVI_Crossville + + + + + + + + + Check gstreamer png decode status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_image_pngdec.sh + + + IVI + Netbook + TV + + + + + + + + + Check gstreamer png encode status + 0 + + + /usr/share/tests/common-multimedia-suite/tts-gstreamer-tests/gstreamer_image_pngenc.sh + + + Netbook + TV + IVI_Crossville + + + + + + diff --git a/ivi/tts-pulseaudio-tests/README b/ivi/tts-pulseaudio-tests/README new file mode 100755 index 0000000..267ec7f --- /dev/null +++ b/ivi/tts-pulseaudio-tests/README @@ -0,0 +1,34 @@ +----------------------- + Introduction +----------------------- +tts-pulseaudio-tests is a test suite for pulseaudio. +Pulseaudio is an open source audio server under Linux. + +The auto test cases cover the basic sink & source query, +sink & source load/unload, setup default sink & source, +playback sample file etc. + + + +----------------------- +How to Run +----------------------- +Pre-condition: +1. if you don't have testkit-lite, you can get it from https://github.com/testkit/testkit-lite + +Steps: +1. prepare some media files and configure /usr/share/tests/common-multimedia-suite/tts-pulseaudio-tests/env.sh --- specify in env.sh +2. launch terminal app in weston UI and play an audio by command "paplay /usr/share/sounds/alsa/Front_Center.wav" to trigger Pulseaudio daemon +3. testkit-lite -f /usr/share/tests/common-multimedia-suite/tts-pulseaudio-tests/tests.xml --comm localhost -o ./results.xml + + +---------------------- +Test Environment setup +---------------------- +Some audio files are needed(WAVE files), you can configure /usr/share/tests/common-multimedia-suite/tts-pulseaudio-tests/env.sh to specify +them; e.g. MF_TEST_8K="/usr/share/tests/common-multimedia-suite/tts-pulseaudio-tests/data/PCM_16bit_Mono_8KHz_128Kbps_60sec\(1Mb\).wav" + + +----------------------- +TODO +----------------------- diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_daemon_status.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_daemon_status.sh new file mode 100755 index 0000000..469f456 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_daemon_status.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +# Modificator: cathy.li@intel.com Date: 2012-05-24 +# Update the code of check pulseaudio daemon +#DESCR: Check PulseAudio daemon + +DAEMON="pulseaudio" + +# Setup the execution environment +. $(cd `dirname $0`;pwd)/env.sh + +#pulseaudio --check + +if ps -ef |grep -v "grep" |grep "$DAEMON" >/dev/null 2>&1 +then + echo "Success: $DAEMON daemon is running" +else + echo "Fail: $DAEMON daemon is not running" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_default_settings.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_default_settings.sh new file mode 100755 index 0000000..6a2f93f --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_default_settings.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +# Check default settings + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 pulseaudio --dump-conf" +else + pulseaudio --dump-conf +fi +if [ $? -ne 0 ]; then + echo "Failed to pulseaudio --dump-conf" + exit 1 +fi +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 pulseaudio --dump-modules" +else + pulseaudio --dump-modules +fi +if [ $? -ne 0 ]; then + echo "Failed to pulseaudio --dump-modules" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_loaded_statistics.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_loaded_statistics.sh new file mode 100755 index 0000000..bff563a --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_loaded_statistics.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# PulseAudio Statistics & all current loaded modules, available sinks, sources, streams and clients + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c 'XDG_RUNTIME_DIR=/run/user/5000 pactl stat' +else + pactl stat +fi + +if [ $? -ne 0 ]; then + echo "Failed to pactl stat" + exit 1 +fi +if [ $UID = 0 ];then + su - app -c 'XDG_RUNTIME_DIR=/run/user/5000 pactl list' +else + pactl list +fi + +if [ $? -ne 0 ]; then + echo "Failed to pactl list" + exit 1 +fi diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_sample_cache.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_sample_cache.sh new file mode 100755 index 0000000..80755f4 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Check_sample_cache.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# load sample, play sample, unload sample + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 pactl upload-sample ${MF_TEST_WAV} test_sample" +else + pactl upload-sample ${MF_TEST_WAV} test_sample +fi +if [ $? -ne 0 ]; then + echo "Failed to upload-sample" + exit 1 +fi + +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 pactl play-sample test_sample" +else + pactl play-sample test_sample +fi +if [ $? -ne 0 ]; then + echo "Failed to play sample" + exit 1 +fi + +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 pactl remove-sample test_sample" +else + pactl remove-sample test_sample +fi +if [ $? -ne 0 ]; then + echo "Failed to unload modules" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Load_unload_module.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Load_unload_module.sh new file mode 100755 index 0000000..07d4223 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Load_unload_module.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# load module, unload module + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cm load module-null-sink sink_name=pa_test_sink > /tmp/test_result" +else + $UTILS_PATH/pa_query_control -cm load module-null-sink sink_name=pa_test_sink > "$TEST_RESULT" +fi + +if [ $? -ne 0 ]; then + echo "Failed to load module" + exit 1 +fi +cat "$TEST_RESULT" + +index=`cat "$TEST_RESULT" | awk -F= '{print $2}'` +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qm" +else + $UTILS_PATH/pa_query_control -qm +fi + +if [ $? -ne 0 ]; then + echo "Failed to query modules" + exit 1 +fi +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cm unload `cat /tmp/test_result|awk -F= '{print $2}'`" +else + $UTILS_PATH/pa_query_control -cm unload $index +fi + +if [ $? -ne 0 ]; then + echo "Failed to unload modules" + exit 1 + +fi + +rm "$TEST_RESULT" diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Mono_8KHz.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Mono_8KHz.sh new file mode 100755 index 0000000..c385a26 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Mono_8KHz.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Play a mono raw PCM audio file by paplay with default settings +# +# TIMEOUT: 90 + +. $(cd `dirname $0`;pwd)/env.sh + +#DATA="$DATA_PATH/PCM_16bit_Mono_8KHz_128Kbps_60sec(1Mb).wav" +#if ! [ -f $DATA ]; then +# echo "Error: not exist the file $DATA" +# exit 1 +#fi + +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 paplay ${MF_TEST_8K}" +else + paplay ${MF_TEST_8K} +fi +if [ $? -ne 0 ]; then + echo "Failed to play the sample" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Multichannel_48KHz.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Multichannel_48KHz.sh new file mode 100755 index 0000000..739d53f --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Multichannel_48KHz.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Play a multichannel raw PCM audio file by paplay with default settings +# +# TIMEOUT: 70 + + +. $(cd `dirname $0`;pwd)/env.sh + +#DATA="$DATA_PATH/PCM_16bit_5.1(Discrete)_48KHz_4608Kbps_38sec(21MB).wav" +#if ! [ -f $DATA ]; then +# echo "Error: not exist the file $DATA" +# exit 1 +#fi + +if [ $UID = 0 ];then + echo $MF_TEST_48K + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 paplay ${MF_TEST_48K}" +else + paplay $MF_TEST_48K +fi +if [ $? -ne 0 ]; then + echo "Failed to play the sample" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Stereo_44.1KHz.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Stereo_44.1KHz.sh new file mode 100755 index 0000000..12e6f7a --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_16bit_Stereo_44.1KHz.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Play a stereo raw PCM audio file by paplay with default settings +# +# TIMEOUT: 20 + + +. $(cd `dirname $0`;pwd)/env.sh + +#DATA="$DATA_PATH/PCM_16bit_Stereo_44.1KHz_1411Kbps_10s(1.6Mb).WAV" +#if ! [ -f $DATA ]; then +# echo "Error: not exist the file $DATA" +# exit 1 +#fi + +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 paplay ${MF_TEST_44K_1}" +else + paplay ${MF_TEST_44K_1} +fi + +if [ $? -ne 0 ]; then + echo "Failed to play the sample" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_2_streams.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_2_streams.sh new file mode 100755 index 0000000..fa6a55c --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_2_streams.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Play 2 PCM audio files by paplay simultaneously with default settings +# +# TIMEOUT: 90 + + +. $(cd `dirname $0`;pwd)/env.sh + +#DATA1="$DATA_PATH/PCM_16bit_Stereo_44.1KHz_1411Kbps_10s(1.6Mb).WAV" +#if ! [ -f $DATA1 ]; then +# echo "Error: not exist the file $DATA1" +# exit 1 +#fi +# +#DATA2="$DATA_PATH/PCM_16bit_Stereo_44.1KHz_1412.2Kbps_60sec(10Mb).wav" +#if ! [ -f $DATA2 ]; then +# echo "Error: not exist the file $DATA2" +# exit 1 +#fi + +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 paplay ${MF_TEST_44K_1}" & su app -c "XDG_RUNTIME_DIR=/run/user/5000 paplay ${MF_TEST_44K_2}" +else + paplay ${MF_TEST_44K_1} & paplay ${MF_TEST_44K_2} +fi +if [ $? -ne 0 ]; then + echo "Failed to play the sample" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_stress_repeat.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_stress_repeat.sh new file mode 100755 index 0000000..70d22d0 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Play_PCM_stress_repeat.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Play a raw PCM audio file by paplay repeat for 100 times with default settings +# +# TIMEOUT: 1500 + + +. $(cd `dirname $0`;pwd)/env.sh + +#DATA="$DATA_PATH/test.wav" +#if ! [ -f $DATA ]; then +# echo "Error: not exist the file $DATA" +# exit 1 +#fi + +count=1 +while [ "$count" -le 100 ] +do + echo "$count time(s) played." + if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 paplay ${MF_TEST_WAV}" + else + paplay ${MF_TEST_WAV} + fi + if [ $? -ne 0 ]; then + echo "Failed to paplay : $count" + exit 1 + fi + let "count += 1" # increase count +done + + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_clients.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_clients.sh new file mode 100755 index 0000000..72f0ce0 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_clients.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# query loaded clients +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qc" +else + $UTILS_PATH/pa_query_control -qc +fi + +if [ $? -ne 0 ]; then + echo "Failed to query loaded clients" + exit 1 +fi + + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_sinks.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_sinks.sh new file mode 100755 index 0000000..c3a209b --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_sinks.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# query loaded sinks + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" +else + $UTILS_PATH/pa_query_control -qs +fi +if [ $? -ne 0 ]; then + echo "Failed to query loaded sinks" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_sources.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_sources.sh new file mode 100755 index 0000000..031e66f --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_loaded_sources.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# query loaded sources + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qo" +else + $UTILS_PATH/pa_query_control -qo +fi + +if [ $? -ne 0 ]; then + echo "Failed to query loaded sources" + exit 1 +fi + + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_memory_statistics.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_memory_statistics.sh new file mode 100755 index 0000000..36e3db2 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_memory_statistics.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# query memory block statistics + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 pacmd stat" +else + pacmd stat +fi +if [ $? -ne 0 ]; then + echo "Failed to pacmd stat" + exit 1 +fi diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_server_info.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_server_info.sh new file mode 100755 index 0000000..cec484d --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_server_info.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# query server information + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh + +#$UTILS_PATH/pa_query_control -qi +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 pacmd info" +else + pacmd info +fi +if [ $? -ne 0 ]; then + echo "Failed to query server information" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_sink_inputs.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_sink_inputs.sh new file mode 100755 index 0000000..0bf53ee --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Query_sink_inputs.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# query sink inputs + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qI" +else + $UTILS_PATH/pa_query_control -qI +fi + +if [ $? -ne 0 ]; then + echo "Failed to query sink inputs" + exit 1 +fi + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_PCM_default.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_PCM_default.sh new file mode 100755 index 0000000..d55d0dd --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_PCM_default.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Record a raw PCM audio file by parec with default settings +# +# TIMEOUT: 90 + + +DATA=/tmp/parec.wav + +# Record a raw PCM audio/noise +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 parec --record /tmp/parec.wav &" +else + parec --record $DATA & +fi + +# Stop recording after 10 seconds +sleep 10 + +COUNT=0 +while [ "$COUNT" -lt 3 ] # try 3 times +do + PID=`ps -eaf | grep parec | grep -v "grep" | awk '{print $2}'` + if [ -z "$PID" ]; then + break; + fi + kill $PID + let "COUNT += 1" # increase COUNT +done + +# Check the recorded audio file +if ! [ -s $DATA ]; then + echo "Error: failed to record voice by parec with default settings" + exit 1 +fi + +rm -f $DATA +exit 0 diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_PCM_long_lasting.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_PCM_long_lasting.sh new file mode 100755 index 0000000..b40682a --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_PCM_long_lasting.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# Modification: +# Li Cathy +# Date: 2012-01-18 +# Update description and record time +# +# DESCR: +# Record a raw PCM audio file by parec long time with default settings, and +# play the recorded audio file by paplay +# +# TIMEOUT: 2000 + + +DATA=/tmp/parec.wav + +# Record a raw PCM audio/noise +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 parec --record /tmp/parec.wav &" +else + parec --record $DATA & +fi + +# Last for 900 seconds +sleep 900 + +COUNT=0 +while [ "$COUNT" -lt 3 ] # try 3 times +do + PID=`ps -eaf | grep parec | grep -v "grep" | awk '{print $2}'` + if [ -z "$PID" ]; then + break; + fi + kill $PID + let "COUNT += 1" # increase COUNT +done + +# Check the recorded audio file +if ! [ -s $DATA ]; then + echo "Error: failed to record voice by parec with default settings" + exit 1 +fi + +# Play the recorded audio file +if [ $UID = 0 ];then + su - app -c 'XDG_RUNTIME_DIR=/run/user/5000 paplay --raw /tmp/parec.wav' +else + paplay --raw $DATA +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to play the recorded audio file" + exit 1 +fi + +rm -f $DATA +exit 0 diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_play_PCM_default.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_play_PCM_default.sh new file mode 100755 index 0000000..fa45ff3 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Record_play_PCM_default.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Record a raw PCM audio file by parec with default settings, and +# play the recorded audio file by paplay +# +# TIMEOUT: 120 + + +DATA=/tmp/parec.wav + +# Record a raw PCM audio/noise +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 parec --record /tmp/parec.wav &" +else + parec --record $DATA & +fi + +# Stop recording after 10 seconds +sleep 10 + +COUNT=0 +while [ "$COUNT" -lt 3 ] # try 3 times +do + PID=`ps -eaf | grep parec | grep -v "grep" | awk '{print $2}'` + if [ -z "$PID" ]; then + break; + fi + kill $PID + let "COUNT += 1" # increase COUNT +done + +# Check the recorded audio file +if ! [ -s $DATA ]; then + echo "Error: failed to record voice by parec with default settings" + exit 1 +fi + +# Play the recorded audio file +if [ $UID = 0 ];then + su - app -c 'XDG_RUNTIME_DIR=/run/user/5000 paplay --raw /tmp/parec.wav' +else + paplay --raw $DATA +fi +if [ $? -ne 0 ]; then + echo "Error: failed to play the recorded audio file" + exit 1 +fi + +rm -f $DATA +exit 0 diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_default_sink.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_default_sink.sh new file mode 100755 index 0000000..554a640 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_default_sink.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# Set default sink + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cm load module-null-sink sink_name=pa_test_sink > /tmp/test_result" +else + $UTILS_PATH/pa_query_control -cm load module-null-sink sink_name=pa_test_sink > "$TEST_RESULT" +fi + +if [ $? -ne 0 ]; then + echo "Failed to load module" + exit 1 +fi +cat "$TEST_RESULT" +index=`cat "$TEST_RESULT" | awk -F= '{print $2}'` +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cd sink pa_test_sink" +else + $UTILS_PATH/pa_query_control -cd sink pa_test_sink +fi + +if [ $? -ne 0 ]; then + echo "Failed to set default sink" + exit 1 +fi + +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cm unload `cat /tmp/test_result|awk -F= '{print $2}'`" +else + $UTILS_PATH/pa_query_control -cm unload $index +fi + +if [ $? -ne 0 ]; then + echo "Failed to unload module" + exit 1 +fi + +rm -f $TEST_RESULT +exit 0 diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_default_source.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_default_source.sh new file mode 100755 index 0000000..4101613 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_default_source.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Chen, Hao +# +# Set default source + +# Modifications: +# Modificator: shuang.wan@intel.com Date: 2010-07-09 +# Content of Modification +# 1) Supplement the comments to the script file +# 2) Move the environment variables initlization to env.sh + +. $(cd `dirname $0`;pwd)/env.sh +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cm load module-pipe-source source_name=test_source > /tmp/test_result" +else + $UTILS_PATH/pa_query_control -cm load module-pipe-source source_name=test_source > "$TEST_RESULT" +fi + +if [ $? -ne 0 ]; then + echo "Failed to load module" + exit 1 +fi +cat "$TEST_RESULT" +index=`cat "$TEST_RESULT" | awk -F= '{print $2}'` +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cd source test_source" +else + $UTILS_PATH/pa_query_control -cd source test_source +fi + +if [ $? -ne 0 ]; then + echo "Failed to set default source" + exit 1 +fi + +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cm unload `cat /tmp/test_result|awk -F= '{print $2}'`" +else + $UTILS_PATH/pa_query_control -cm unload $index +fi + +if [ $? -ne 0 ]; then + echo "Failed to unload module" + exit 1 +fi + +rm -f "$TEST_RESULT" diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_mute.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_mute.sh new file mode 100755 index 0000000..34747de --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_mute.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Set default sink mute +# TIMEOUT: 30 + + +. $(cd `dirname $0`;pwd)/env.sh + +# Find the sink name and mute status +if [ $UID = 0 ];then + SINK_NAME=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs"|head -n 1 | awk -F, '{print $2}' | cut -d "=" -f2` + MUTED=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" | head -n 1 | awk -F, '{print $5}' | cut -d "=" -f2` +else + SINK_NAME=`$UTILS_PATH/pa_query_control -qs | awk -F, '{print $2}' | cut -d "=" -f2` + MUTED=`$UTILS_PATH/pa_query_control -qs | awk -F, '{print $5}' | cut -d "=" -f2` +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to find sink mute status" + echo "Please check that if pulseaudio is running or if proper permission is granted" + exit 1 +fi + +# Set sink muted +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cu sink $SINK_NAME 1" +else + $UTILS_PATH/pa_query_control -cu sink $SINK_NAME 1 +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to set sink <$SINK_NAME> mute" + exit 1 +fi + +# Check sink mute status +if [ $UID = 0 ];then + SETED=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" | head -n 1 | awk -F, '{print $5}' | cut -d "=" -f2` +else + SETED=`$UTILS_PATH/pa_query_control -qs | awk -F, '{print $5}' | cut -d "=" -f2` +fi +if [ $SETED != "1" ]; then + echo "Error: not set sink mute" + exit 1 +fi + +# Post: set back the sink mute status +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cu sink $SINK_NAME $MUTED" +else + $UTILS_PATH/pa_query_control -cu sink $SINK_NAME $MUTED +fi +exit 0 + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_unmute.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_unmute.sh new file mode 100755 index 0000000..66a74dd --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_unmute.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Set default sink unmute +# TIMEOUT: 30 + + +. $(cd `dirname $0`;pwd)/env.sh + +# Find the sink name and mute status +if [ $UID = 0 ];then + SINK_NAME=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" |grep -i 'alsa_output' | awk -F, '{print $2}' | cut -d "=" -f2` + MUTED=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" |grep -i 'alsa_output' | awk -F, '{print $5}' | cut -d "=" -f2` +else + SINK_NAME=`$UTILS_PATH/pa_query_control -qs | awk -F, '{print $2}' | cut -d "=" -f2` + MUTED=`$UTILS_PATH/pa_query_control -qs | awk -F, '{print $5}' | cut -d "=" -f2` +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to find sink mute status" + echo "Please check that if pulseaudio is running or if proper permission is granted" + exit 1 +fi + +# Set sink unmute +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cu sink $SINK_NAME 0" +else + $UTILS_PATH/pa_query_control -cu sink $SINK_NAME 0 +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to set sink <$SINK_NAME> unmute" + exit 1 +fi + +# Check sink mute status +if [ $UID = 0 ];then + SETED=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" |grep -i 'alsa_output' | awk -F, '{print $5}' | cut -d "=" -f2` +else + SETED=`$UTILS_PATH/pa_query_control -qs | awk -F, '{print $5}' | head -n 1 |cut -d "=" -f2` +fi + +if [ "X$SETED" != "X0" ]; then + echo "Error: not set sink unmute" + exit 1 +fi + +# Post: set back the sink mute status +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cu sink $SINK_NAME $MUTED" +else + $UTILS_PATH/pa_query_control -cu sink $SINK_NAME $MUTED +fi +exit 0 + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_volume.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_volume.sh new file mode 100755 index 0000000..dfd4805 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_sink_volume.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Set default sink vloume value +# TIMEOUT: 30 + + +. $(cd `dirname $0`;pwd)/env.sh + +# Find the sink name and volume value +if [ $UID = 0 ];then + SINK_NAME=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" | head -n 1 | awk -F, '{print $2}' | cut -d "=" -f2` + VOLUME=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qs" | head -n 1| awk -F, '{print $4}' | cut -d "=" -f2 | awk '{print $2}'` +else + SINK_NAME=`$UTILS_PATH/pa_query_control -qs | head -n 1 | awk -F, '{print $2}' | cut -d "=" -f2` + VOLUME=`$UTILS_PATH/pa_query_control -qs | head -n 1| awk -F, '{print $4}' | cut -d "=" -f2 | awk '{print $2}'` +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to find sink volume value" + echo "Please check that if pulseaudio is running or if proper permission is granted" + exit 1 +fi + +# Set sink volume value for the 1st channel +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv sink $SINK_NAME 1 0" + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv sink $SINK_NAME 1 1000" + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv sink $SINK_NAME 1 30000" + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv sink $SINK_NAME 1 65536" +else + $UTILS_PATH/pa_query_control -cv sink $SINK_NAME 1 0 + $UTILS_PATH/pa_query_control -cv sink $SINK_NAME 1 1000 + $UTILS_PATH/pa_query_control -cv sink $SINK_NAME 1 30000 + $UTILS_PATH/pa_query_control -cv sink $SINK_NAME 1 65536 +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to set sink <$SINK_NAME> volume value" + exit 1 +fi + +# Post: set back the sink volume value +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv sink $SINK_NAME 1 $VOLUME" +else + $UTILS_PATH/pa_query_control -cv sink $SINK_NAME 1 $VOLUME +fi +exit 0 + diff --git a/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_source_volume.sh b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_source_volume.sh new file mode 100755 index 0000000..28cc9a4 --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/PulseAudio_Set_source_volume.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Copyright (C) 2011 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: +# Zhang, Zhiqiang +# +# DESCR: +# Set default source vloume value +# TIMEOUT: 30 + + +. $(cd `dirname $0`;pwd)/env.sh + +# Find the source name and volume value +if [ $UID = 0 ];then + SOURCE_NAME=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qo" | head -n 1 | awk -F, '{print $2}' | cut -d "=" -f2` + VOLUME=`su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -qo" | head -n 1 | awk -F, '{print $4}' | cut -d "=" -f2 | awk '{print $2}'` +else + SOURCE_NAME=`$UTILS_PATH/pa_query_control -qo | head -n 1 | awk -F, '{print $2}' | cut -d "=" -f2` + VOLUME=`$UTILS_PATH/pa_query_control -qo | head -n 1 | awk -F, '{print $4}' | cut -d "=" -f2 | awk '{print $2}'` +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to find source volume value" + echo "Please check that if pulseaudio is running or if proper permission is granted" + exit 1 +fi + +# Set source volume value for the 1st channel +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv source $SOURCE_NAME 1 65536" + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv source $SOURCE_NAME 1 40000" + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv source $SOURCE_NAME 1 8000" + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv source $SOURCE_NAME 1 0" +else + $UTILS_PATH/pa_query_control -cv source $SOURCE_NAME 1 65536 + $UTILS_PATH/pa_query_control -cv source $SOURCE_NAME 1 40000 + $UTILS_PATH/pa_query_control -cv source $SOURCE_NAME 1 8000 + $UTILS_PATH/pa_query_control -cv source $SOURCE_NAME 1 0 +fi + +if [ $? -ne 0 ]; then + echo "Error: failed to set source <$SOURCE_NAME> volume value" + exit 1 +fi + +# Post: set back the source volume value +if [ $UID = 0 ];then + su - app -c "XDG_RUNTIME_DIR=/run/user/5000 /opt/tts-pulseaudio-tests/pa_query_control -cv source $SOURCE_NAME 1 $VOLUME" +else + $UTILS_PATH/pa_query_control -cv source $SOURCE_NAME 1 $VOLUME +fi +exit 0 + diff --git a/ivi/tts-pulseaudio-tests/src/env.sh b/ivi/tts-pulseaudio-tests/src/env.sh new file mode 100755 index 0000000..08145ca --- /dev/null +++ b/ivi/tts-pulseaudio-tests/src/env.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Copyright (C) 2010 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# +# Authors: +# Wan Shuang +# Date Created: 2010/07/08 +# +# Modifications: +# Modificator Date +# Content of Modification +# + +UTILS_PATH=$(cd `dirname $0`;pwd) +DATA_PATH=$(cd `dirname $0`;pwd)/data +TEST_RESULT="/tmp/test_result" + +## below media files are needed but not include in this package, prepare them before run test ## + +# used in script: PulseAudio_Play_PCM_16bit_Multichannel_48KHz.sh +# wav audio: RIFF (little-endian) data, WAVE audio, 6 channels 48000 Hz +MF_TEST_48K="/opt/tts-pulseaudio-tests/data/PCM_16bit_5.1_48KHz_4608Kbps_38sec.wav" + +# used in script: PulseAudio_Play_PCM_16bit_Mono_8KHz.sh +# wav audio: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz +MF_TEST_8K="/opt/tts-pulseaudio-tests/data/PCM_16bit_Mono_8KHz_128Kbps_60sec.wav" + +# used in script: PulseAudio_Play_PCM_16bit_Stereo_44.1KHz.sh/PulseAudio_Play_PCM_2_streams.sh +# wav audio: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz +MF_TEST_44K_1="/opt/tts-pulseaudio-tests/data/PCM_16bit_Stereo_44.1KHz_1411Kbps_10s.WAV" + +# used in script: PulseAudio_Play_PCM_2_streams.sh +# wav audio: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz +MF_TEST_44K_2="/opt/tts-pulseaudio-tests/data/PCM_16bit_Stereo_44.1KHz_1412.2Kbps_60sec.wav" + +# used in script: PulseAudio_Check_sample_cache.sh/PulseAudio_Play_PCM_stress_repeat.sh +# wav audio: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz +MF_TEST_WAV="/opt/tts-pulseaudio-tests/data/test.wav" + +## END ## + +export PATH=$PATH:/sbin/:/usr/sbin/ diff --git a/ivi/tts-pulseaudio-tests/src/pa_query_control b/ivi/tts-pulseaudio-tests/src/pa_query_control new file mode 100755 index 0000000..e3fa83b Binary files /dev/null and b/ivi/tts-pulseaudio-tests/src/pa_query_control differ diff --git a/ivi/tts-pulseaudio-tests/tests.xml b/ivi/tts-pulseaudio-tests/tests.xml new file mode 100644 index 0000000..f703fdb --- /dev/null +++ b/ivi/tts-pulseaudio-tests/tests.xml @@ -0,0 +1,460 @@ + + + + + + + + + + Play a raw PCM audio file by paplay repeat for 100 times with default settings + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Play_PCM_stress_repeat.sh + + + Netbook + TV + + + + + + + + + Play a multichannel raw PCM audio file by paplay with default settings + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Play_PCM_16bit_Multichannel_48KHz.sh + + + Netbook + TV + + + + + + + + + Play a stereo raw PCM audio file by paplay with default settings + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Play_PCM_16bit_Stereo_44.1KHz.sh + + + IVI + Netbook + TV + + + + + + + + + Play 2 PCM audio files by paplay simultaneously with default settings + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Play_PCM_2_streams.sh + + + IVI + Netbook + TV + + + + + + + + + Play a mono raw PCM audio file by paplay with default settings + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Play_PCM_16bit_Mono_8KHz.sh + + + IVI + Netbook + TV + + + + + + + + + + + Query loaded sources + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Query_loaded_sources.sh + + + IVI + Netbook + TV + + + + + + + + + Query loaded sinks + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Query_loaded_sinks.sh + + + IVI + Netbook + TV + + + + + + + + + Query server information + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Query_server_info.sh + + + Netbook + TV + + + + + + + + + Query sink inputs + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Query_sink_inputs.sh + + + IVI + Netbook + TV + + + + + + + + + Query memory block statistics + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Query_memory_statistics.sh + + + Netbook + TV + + + + + + + + + Query loaded clients + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Query_loaded_clients.sh + + + IVI + Netbook + TV + + + + + + + + + + + Record a raw PCM audio file by parec with default settings + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Record_PCM_default.sh + + + IVI + Netbook + TV + + + + + + + + + Record a raw PCM audio file by parec with default settings, and play the recorded audio file by paplay + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Record_play_PCM_default.sh + + + IVI + Netbook + TV + + + + + + + + + Record a raw PCM audio file by parec long time with default settings, and play the recorded audio file by paplay + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Record_PCM_long_lasting.sh + + + IVI + Netbook + TV + + + + + + + + + + + PulseAudio Statistics; all current loaded modules, available sinks, sources, streams and clients + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Check_loaded_statistics.sh + + + IVI + Netbook + TV + + + + + + + + + Check PulseAudio daemon status + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Check_daemon_status.sh + + + IVI + Netbook + TV + + + + + + + + + Check default settings + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Check_default_settings.sh + + + IVI + Netbook + TV + + + + + + + + + Load sample, play sample, unload sample + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Check_sample_cache.sh + + + IVI + Netbook + TV + + + + + + + + + + + Set default sink + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Set_default_sink.sh + + + IVI + Netbook + TV + + + + + + + + + Set default sink unmute + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Set_sink_unmute.sh + + + IVI + Netbook + TV + + + + + + + + + Set default source vloume value + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Set_source_volume.sh + + + IVI + Netbook + TV + + + + + + + + + Set default source + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Set_default_source.sh + + + IVI + Netbook + TV + + + + + + + + + Set default sink mute + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Set_sink_mute.sh + + + IVI + Netbook + TV + + + + + + + + + Load module, unload module + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Load_unload_module.sh + + + IVI + Netbook + TV + + + + + + + + + Set default sink vloume value + 0 + + + /opt/tts-pulseaudio-tests/PulseAudio_Set_sink_volume.sh + + + IVI + Netbook + TV + + + + + diff --git a/packaging/common-multimedia-suite.spec b/packaging/common-multimedia-suite.spec new file mode 100755 index 0000000..b467edb --- /dev/null +++ b/packaging/common-multimedia-suite.spec @@ -0,0 +1,92 @@ +%define _unpackaged_files_terminate_build 0 + +Name: common-multimedia-suite +Summary: common-multimedia-suite +Version: 0.1.0 +Release: 1 +License: GPLv2 +Group: Development/Testing +Source0: %{name}-%{version}.tar.gz + +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-base-1.0) +BuildRequires: pkgconfig(gthread-2.0) + +%description +This package is IVI common mutlimedia test suite + +%package -n tts-pulseaudio-tests +Summary: Pulseaudio test suit +Group: Development/Testing + +%description -n tts-pulseaudio-tests +%{summary}. + + +%package -n tts-gstreamer-tests +Summary: Gstreamer test suit +Group: Development/Testing + +%description -n tts-gstreamer-tests +%{summary}. + + + +%package -n gst-auto-launch +Summary: Improved version of gst-launch +Group: Development/Testing/Tool + +%description -n gst-auto-launch +gst-auto-launch is an improved version of gst-launch that accepts commands + +%prep +%setup -q + +%build +./autogen.sh +./configure --prefix=/usr +make + +%install + +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + +install -d %{buildroot}/%{_datadir}/tests/%{name}/tts-pulseaudio-tests +install -m 0755 ivi/tts-pulseaudio-tests/src/* %{buildroot}/%{_datadir}/tests/%{name}/tts-pulseaudio-tests +install -m 0755 ivi/tts-pulseaudio-tests/tests.xml %{buildroot}/%{_datadir}/tests/%{name}/tts-pulseaudio-tests +install -m 0755 ivi/tts-pulseaudio-tests/README %{buildroot}/%{_datadir}/tests/%{name}/tts-pulseaudio-tests +install LICENSE %{buildroot}/%{_datadir}/tests/%{name}/tts-pulseaudio-tests + +install -d %{buildroot}/%{_datadir}/tests/%{name}/tts-gstreamer-tests +install -m 0755 ivi/tts-gstreamer-tests/src/* %{buildroot}/%{_datadir}/tests/%{name}/tts-gstreamer-tests +install -m 0755 ivi/tts-gstreamer-tests/tests.xml %{buildroot}/%{_datadir}/tests/%{name}/tts-gstreamer-tests +install -m 0755 ivi/tts-gstreamer-tests/README %{buildroot}/%{_datadir}/tests/%{name}/tts-gstreamer-tests +install LICENSE %{buildroot}/%{_datadir}/tests/%{name}/tts-gstreamer-tests + + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files -n tts-pulseaudio-tests +%defattr(-,root,root) +%{_datadir}/tests/%{name}/tts-pulseaudio-tests +%license LICENSE + +%files -n tts-gstreamer-tests +%defattr(-,root,root) +%{_datadir}/tests/%{name}/tts-gstreamer-tests +%license LICENSE + +%files -n gst-auto-launch +%defattr(-,root,root) +/usr/bin/gst-auto-launch +%{_datadir}/gst-auto-launch +%license LICENSE + +%changelog +* Thu Nov 2 2012 Wu dawei 0.1.0-1 + - Initial common multimedia suite test +