summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2015-11-13 16:41:06 +0100
committerLuca Barbato <lu_zero@gentoo.org>2015-11-13 16:41:11 +0100
commite1d2c24e29f06a9b43744cf5a00b35e24b5051ee (patch)
tree9b411a360327c91a78e0baa67f6cd8c5a242c82f
parent3b303499969972e45bb147d9d62b850a98c51ac8 (diff)
wip
Libav Sprint discussion, Kostya is fine to relicense to LGPL 2.1 same for me.
-rw-r--r--libavscale/avscale.c13
-rw-r--r--libavscale/avscale.h13
-rw-r--r--libavscale/internal.h13
-rw-r--r--libavscale/utils.c18
-rw-r--r--libavutil/formaton.h23
-rw-r--r--libavutil/frame.c13
6 files changed, 66 insertions, 27 deletions
diff --git a/libavscale/avscale.c b/libavscale/avscale.c
index 4c0b8149ec..7cb5ced43f 100644
--- a/libavscale/avscale.c
+++ b/libavscale/avscale.c
@@ -3,17 +3,18 @@
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
+ * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* Libav 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; see the file COPYING.GPLv3. If not see
- * <http://www.gnu.org/licenses/>.
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
diff --git a/libavscale/avscale.h b/libavscale/avscale.h
index a2f0e04092..7de7d85339 100644
--- a/libavscale/avscale.h
+++ b/libavscale/avscale.h
@@ -3,17 +3,18 @@
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
+ * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* Libav 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; see the file COPYING.GPLv3. If not see
- * <http://www.gnu.org/licenses/>.
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVSCALE_AVSCALE_H
diff --git a/libavscale/internal.h b/libavscale/internal.h
index 4e8e47266e..b8d12c0a0d 100644
--- a/libavscale/internal.h
+++ b/libavscale/internal.h
@@ -3,17 +3,18 @@
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
+ * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* Libav 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; see the file COPYING.GPLv3. If not see
- * <http://www.gnu.org/licenses/>.
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVSCALE_INTERNAL_H
diff --git a/libavscale/utils.c b/libavscale/utils.c
index a97ae87f89..028d55438e 100644
--- a/libavscale/utils.c
+++ b/libavscale/utils.c
@@ -1,4 +1,20 @@
-
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#include "config.h"
#include "avscale.h"
diff --git a/libavutil/formaton.h b/libavutil/formaton.h
index 7d038e67e9..6083186140 100644
--- a/libavutil/formaton.h
+++ b/libavutil/formaton.h
@@ -3,17 +3,18 @@
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
+ * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* Libav 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; see the file COPYING.GPLv3. If not see
- * <http://www.gnu.org/licenses/>.
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_FORMATON_H
@@ -66,6 +67,16 @@ typedef struct AVPixelFormaton {
const char *name;
unsigned flags; // has alpha, uses BE order, uses palette etc
+ /**
+ * Size of all the pixel components packed as one element including
+ * padding.
+ */
+ int pixel_next;
+
+ /**
+ * Number of entries in the palette if a palette is present.
+ */
+ int nb_palette_entries;
enum AVColorRange range;
enum AVColorPrimaries primaries;
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 4d167fbefe..135f6d2480 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -123,11 +123,20 @@ static int get_video_buffer(AVFrame *frame, int align)
frame->data[i] = frame->buf[i]->data;
}
- // XXX luzero wants full fledged palettes
if (frame->formaton->flags & AV_PIX_FMT_FLAG_PAL ||
frame->formaton->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
+ int size;
+
+ // XXX Compatibility until the palette_entries information is
+ // stored somewhere.
+ if (frame->formaton->nb_palette_entries) {
+ size = frame->formaton->nb_palette_entries *
+ frame->formaton->pixel_next;
+ } else
+ size = 1024;
+
av_buffer_unref(&frame->buf[1]);
- frame->buf[1] = av_buffer_alloc(1024);
+ frame->buf[1] = av_buffer_alloc(size);
if (!frame->buf[1])
goto fail;
frame->data[1] = frame->buf[1]->data;